Preview feature? Same file twice on server?

Phoca Download - download manager
Bubbleman
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 18 Apr 2012, 16:07

Preview feature? Same file twice on server?

Post by Bubbleman »

Hello

Do I understand right? If I want to download and preview or play (mp3 in that case) a file in frontend, I have to upload it twice?
once in root/phocadownloadpap and
once in root/phocadownload
????
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48595
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Preview feature? Same file twice on server?

Post by Jan »

Hi, yes.

This feature was added becuase users wishes.

The purpose is for example:

You have PDF document and you wan to give it for download for e.g. registered users, but you want to displayed table of content for all. So ond pdf will include table of content (to preview), second whole book - for downloading.

The same with music, images (e.g. with watermarks, etc.), documents, etc.

Jan
If you find Phoca extensions useful, please support the project
Bubbleman
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 18 Apr 2012, 16:07

Re: Preview feature? Same file twice on server?

Post by Bubbleman »

Hi

I understand.
I discovered, that you can define the "previewfolder" in "option" dialog, thats`s nice.
It would be even nicer if I could chose any folder in the uploadwindow for "preview".
webwzrd
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 31 May 2012, 01:23

Re: Preview feature? Same file twice on server?

Post by webwzrd »

"I discovered, that you can define the "previewfolder" in "option" dialog, thats`s nice.
It would be even nicer if I could chose any folder in the uploadwindow for "preview"."

I found that it works even if you have files in sub-directories under phocadownload, just copy the "Filename" field, which includes the directory string and paste into the "File - Preview" field.

Now, wish I could figure out a SQL query to automate this instead of editing 1,000+ files individually. Anyone know?
webwzrd
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 31 May 2012, 01:23

Re: Preview feature? Same file twice on server?

Post by webwzrd »

Very easy to automate the preview process. All it took was:

UPDATE jos_phocadownload
SET filename_preview = filename
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48595
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Preview feature? Same file twice on server?

Post by Jan »

Ok, thank you for this info.

Jan
If you find Phoca extensions useful, please support the project
keldon
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 14 Jun 2012, 09:21

Re: Preview feature? Same file twice on server?

Post by keldon »

Hello. I'm sure it's easy, but i can't make it work.
Could you specify how and where do i have to introduce the fields UPDATE and SET?
Thank you
thel33tone
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 14 Nov 2012, 05:33

Re: Preview feature? Same file twice on server?

Post by thel33tone »

what you do is open your mySQL workbench program, then open your database (mine is called brickf for brick fire department)
then open tables
then open YOURNAME_phocadownload
then open columns

here you will see both things mentioned in the following query, the filename_preview and filename, these correspond to what you type in those fields when you upload a file. you can right click filename and click edit table data, it should be populated, then right click filename_preview and notice its probably empty enough. we are simply going to ask it to copy and paste for us with the string below. this was my first time ever using a database but i figured it out and i really appreciate when people spell things out so im trying my best to do so here.

note: what i did was change under options in the phocadownload control panel at the bottom where it says advanced, i removed the "pap" from the preview directory so they both use the same folder because that suits my needs. anyway back to database stuff

so it complained the first time i ran my query (im using mysql workbench 5.2.43) that i had to click edit, preferences, SQL queries, then UNCHECK safe updates. it will work now, but you can also kill stuff so back up your site using akeeba backup, its awsome and free. BACK IT UP NOW! so then you can go back to a tab up top, a query, and paste the following, but change my brickf to your database name. then click the lightning bolt to run the query.

UPDATE brickf_phocadownload
SET filename_preview = filename

you can now check the filename_preview column by right clicking it and hit edit table data, it should look just like filename now, if you get any errors check the bottom log. i hope i helped!
Post Reply