[Pro] file download

@DeltaDave : I used this route before but it does not help. Somehow the protection is bypassed. I think it is because everytime you publish the project the file in the protected directory is also generated in the resources directory and this file has probably the preference than the file in the protected directory which is a sub directory in the resource directory.

@ Neil : no spaces in the filename does not help unfortunately


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I think it is because everytime you publish the project the file in the protected directory is also generated in the resources directory

It shouldn’t be. The force download action uploads the PDF alongside the HTML page that the action is applied to along with the FD created PHP file.

If you are getting a link to a PDF in the Resources folder there is something wrong.

In File Document Set Up have you set it for Seperate Resource Folders and can we see a test page.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

First, check to see if you have the Document Setup / Output preference for “Separate Resources folders” chosen. If you don’t, then all of your links will be to files saved in /site_root/Resources, rather than your protected files being in /site_root/protected_folder/Resources (which would be protected).

Second, if that is not the issue, try making a separate Freeway document just for your protected pages. Set it to upload into the /protected_folder/ folder, rather than creating that folder within the Freeway site panel. If it doesn’t know about the subfolder, it won’t try to upload files above its own “root” folder.

Freeway goes well out of its way to conserve your resources. If you have linked to a file on one page, and you create a link to that file in another page that is deeply nested within a folder structure, Freeway will only upload one copy of the file, and will create two links that resolve to that one copy of the file, regardless of the number of folder levels it must hop up and over to get there.

Walter

On Jan 7, 2013, at 7:52 AM, DeltaDave wrote:

I think it is because everytime you publish the project the file in the protected directory is also generated in the resources directory

It shouldn’t be. The force download action uploads the PDF alongside the HTML page that the action is applied to along with the FD created PHP file.

If you are getting a link to a PDF in the Resources folder there is something wrong.

In File Document Set Up have you set it for Seperate Resource Folders and can we see a test page.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I have just been rereading your posts about this and realise that you are going about this the wrong way. You say:

I am probably doing something wrong. I see at my host that the directory is protected. I than copy the file into it and than I download the protected directory into my FW project.

No - nothing should be copied from the server to your Mac

Than I open the FW project and make the link with the file in the protected directory.

Again this is not the way to do it. Create the link in your FW document using the Force Download action to your local copy of the PDF. It does not matter where this file is located on your Mac as the action will place a copy of the PDF alongside the html page that the action is on.

As last step I upload the whole FW project to the server. Note that the protected directory in my FW project located in the resources directory does not upload to the server. I have to to this manually with FTP. This way when I click on the link the file is downloaded and opened. Unfortunately no password is asked !!!

Do not upload the protected folder from your Mac to the server - only the files that are within the Sub Folder that you created within your FW document.

The protected folder on your server (once you have created it and protected it on the server) stays on the server.

So to clarify

Create the subfolder within your FW doc with the same name as the protected folder on your server (in my screenshot I have used ‘download’. Make a new page within that folder (in FW) which will have a link on it using the Force Download action and select the PDF that you want to use.

Publish the FW document.

Because you are not using FW to upload you have to be very careful that you get the right files transferred to the server. In my example I would FTP all the contents of the ‘download’ folder (in the Site Folder on my Mac) into the protected ‘download’ folder on the server but NOT the folder itself!

The files in the ‘download’ folder within the FW site folder will include the page with the link on it, the pdf itself and the -dl.php as well as the Resources and css folders.

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Ok now I understand what one of the things is that i did wrong although problem is not solved yet!! I created the protected directory not in the FW doc but in the sitefolder directory of the project on my HD. So now I created the protected directory in the FW doc as shown in your screendump. I also put the pdf file in the resources directory on my harddisk (you tild me it does not matter where to put it). Than I am stuck what to do because I want to have this forced link on every page of the website. Does this mean I have to copy all pages in the protected directory in the FW DOC, put the forced download actionon each page or just a duplcicate of the MASTER with the forced download action item ???


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

So now I created the protected directory in the FW doc as shown in your screendump.

Yes - create the folder in the FW document but also mirror this on the server but do NOT upload the FW created file - ONLY its contents!

I also put the pdf file in the resources directory on my harddisk

No - never add anything to your Resources folder. That is FW’s domain and it manages its contents. Stay out unless you know what you are doing.

you told me it does not matter where to put it

I told you it doesn’t matter because FW makes a copy of it and places it alongside the html page that the action is on. Original files (like your PDF) should be kept in the Media folder - just to keep all these files together.

Your real problem stems from the fact that you are uploading via FTP and you really are not that sure what files should actually be uploaded and to where.

If you want a link to this PDF on every page then create a link to the page in the protected folder where the Force Download link will be.

Does this mean I have to copy all pages in the protected directory in the FW DOC, put the forced download actionon each page

No - have a normal link (on every page) to the page in the Protected folder where the FD action is.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

so in the ‘download’ folder within the FW site folder I have to copy the ‘file’ i want to link to the forced download action, the already present css en resources directories (copy or move ???) and all the pages (copy or move) within the sitefolder (since I want the link on all pages) ???


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

so in the ‘download’ folder within the FW site folder I have to copy the ‘file’ i want to link to

Copy ALL of the files in the FW created ‘download’ folder in the Site folder via FTP to your protected folder on the server.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

in the protected directory called “download” on the host I copied all the files from the directory
'Download" created by FW in the site folder as you suggested. Still the protection is bypassed, so if I click on the forced php download link the file just opens without asking user/password !!! very strange it does not work, maybe my host does not support it somehow. I give up and just wil use the “link to file” action instead :-((((


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Once you authenticate into a realm, you don’t have to do it again until you completely restart your browser. Are you testing this by completely quitting your browser, starting up again, and then visiting the page?

Walter

On Jan 9, 2013, at 5:55 AM, Artivideo wrote:

in the protected directory called “download” on the host I copied all the files from the directory
'Download" created by FW in the site folder as you suggested. Still the protection is bypassed, so if I click on the forced php download link the file just opens without asking user/password !!! very strange it does not work, maybe my host does not support it somehow. I give up and just wil use the “link to file” action instead :-((((


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I give up and just will use the “link to file” action instead :-((((

Why not post a link to a test and we can see if it works for us - it might just be you/your browser.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

@waltd

I use safari but also other with other browsers it does not work (again it only works if I use the acyion “link to file” (you can see that working on my site www.artivideo.nl, de VAR button on the left bottom) but not when I use the :force php dowload" action. I did a empty cash, reset safari, than closed the browser. After opening the browser the user/passw is still bypassed.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Then the file isn’t ending up in the right folder on your server. I recommend you try the following, just to confirm my suspicions.

  1. Make a new Freeway document, set it to publish into the protected folder you already made at your ISP.
  2. On the index page of that new document, draw an HTML box and double-click into it.
  3. From the main menu, choose Insert / Action Item / Link to File.
  4. In the Actions palette, choose your desired protected file, and enter your link text.

Publish and upload from Freeway into the protected folder. If you’re looking at your site through an FTP application, you should see the following structure:

/http_docs/    (or whatever it's called there)
	/protected/
		index.html
		/Resources/
			_clear.gif
			protected_file.pdf

Obviously, there will be other files as well, but that’s the point I want to make – your file that you want to have download after a password must be inside or nested below that /protected/ folder (or whatever else you called it – the name doesn’t confer any protection).

Now if you visit http://example.com/protected/ you should be challenged for a password. If you provide it once (per session) you should then be able to see index.html, which shows you a link to http://example.com/protected/Resources/protected_file.pdf. If you click on that link, you should (without any further password hoohah) get that file. If you then copy the entire link to the protected file, quit your browser, start it back up, and paste that URL into the Location field, you should be challenged once again for the password.

This is how Basic Auth security realms work: you are challenged only once per session for access to the protected folder and anything stored beneath that level of the filesystem hierarchy. You said that you weren’t being challenged at all, which leads me to suspect that the file wasn’t being uploaded where you thought it was.

Walter

On Jan 9, 2013, at 6:52 PM, Artivideo wrote:

@waltd

I use safari but also other with other browsers it does not work (again it only works if I use the acyion “link to file” (you can see that working on my site www.artivideo.nl, de VAR button on the left bottom) but not when I use the :force php dowload" action. I did a empty cash, reset safari, than closed the browser. After opening the browser the user/passw is still bypassed.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

you can see that working on my site www.artivideo.nl, de VAR button on the left bottom

Yes I see that works.

What I had suggested was that you use an ordinary link to a page within the protected folder.

And then on that page you use the Force Download action to link to the actual PDF.

See if that works for you.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

@waltd

hmm I thought i explained that the pdf file in the protected directory (host) in combination with the “link to file” action script works (I even dont need to have a similar named directory in sitefolder in the FW doc !!!). You can check this on my page (the VAR link) However the “forced PHP download” action does not work.

I uploaded with FW and checked with FTP if everything is there and it was.

@Deltadave

Not sure what you are suggesting but i have a feeling it is a work around. It should work as intended.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

My point here was that any file (no matter what type) will be a required download if the file in question that is being downloaded is inside the protected folder.

The PHP Force Download Action puts the file to be downloaded in the same folder as the PHP/HTML page that it is on. So if you have a setup like this:

server_site_folder/
	downloads.php <- the page with the PHP Force Download Action on it
	downloads/ <- the folder you protected
		protected_file.pdf

Then what’s really happening is this (when the Action uploads the file to be “forced”:

server_site_folder/
	downloads.php <- the page with the PHP Force Download Action on it
	downloads/ <- the folder you protected
		protected_file.pdf
	protected_file.pdf

And the link on downloads.php is actually to the copy of the file outside of the protected folder.

Now if you move the downloads.php file inside the /downloads folder, it will also be protected by the htaccess rule added by your server, and any of its peers (like the protected file) will as well. You would end up with this construction instead:

server_site_folder/
	downloads/ <- the folder you protected
		downloads.php <- the page with the PHP Force Download Action on it
		protected_file.pdf

Walter

On Jan 10, 2013, at 3:17 PM, Artivideo wrote:

@waltd

hmm I thought i explained that the pdf file in the protected directory (host) in combination with the “link to file” action script works (I even dont need to have a similar named directory in sitefolder in the FW doc !!!). You can check this on my page (the VAR link) However the “forced PHP download” action does not work.

I uploaded with FW and checked with FTP if everything is there and it was.

@Deltadave

Not sure what you are suggesting but i have a feeling it is a work around. It should work as intended.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Not sure what you are suggesting but i have a feeling it is a work around. It should work as intended.

Each of these actions on its own works as intended. But as Walter has pointed out the Force Download action will upload the File to be downloaded into the same folder as the page on which the action is placed.

In your case this is outwith the protected folder and that is why I suggested putting the Force Download link on a page that was within the protected folder.

Now if the Link to File action (linking to a file within the protected folder) works for you AND ALWAYS downloads the file then that is good and we can bring this thread to a close.

But others who follow may prefer their links to be on a page within the Protected folder especially if they have several and they do not want visitors to even know the names of the files in question.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

“In your case this is outwith the protected folder and that is why I suggested putting the Force Download link on a page that was within the protected folder”

Since I have the “forced download action” also on my index site this means that I have to have 2 index files on my host : one in the root (else my website will not be online) and one in the protected file.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Since I have the “forced download action” also on my index site this means that I have to have 2 index files on my host : one in the root (else my website will not be online) and one in the protected file.

That is why I suggested that you make standard links to a page (in the protected folder) where the Force Download action is applied.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options