Welcome! Log In Create A New Profile

Advanced

Problem with generate download dialogue to download pdf file

Posted by vicheka.pcs.crosspost 
vicheka.pcs.crosspost
Problem with generate download dialogue to download pdf file
May 01, 2009 07:32PM
Dear everybody,
I have a problem with this please help:
First, I develop on webdev and now i create a button to read the pdf file and another button to download pdf file and for the button read pdf file it is now ok but for button to make a download Dialogue for user to download the pdf still not ok yet and in order to do this i found that in webdev already have the function to do this:
FileDisplay(...); however, it needs the complete exact path. For example,
FileDisplay(CompleteDir(fWebDir()) + "install_reel.pdf", "application/unknown","install_reel.pdf")
yes this code is ok it can generate a download dialogue but you know for my case for the path to download the pdf is taken from database and the path looks like this: "[192.168.100.3]; (not real just an example) and thus i try test this case as following line:
FileDisplay("[192.168.100.3];, "application/unknown","install_reel.pdf")
But it is not working and gives the error as following:
Impossible d'ouvrir le fichier <C:\AKOS_TP_WEBSITE\Exe\http:\192.168.100.3\akostp\pdf\install_reel.pdf>.

Do you have any ideas please give me? Please help....

Best Regards,
Vicheka

Message forwarded from pcsoft.us.windev
Ruben Sanchez Peña
Re: Problem with generate download dialogue to download pdf file
May 02, 2009 02:43PM
Hi. The first parameter is a file system, not a web url.

If the file is in other web server you can:

1) Put the url in a Link control. When the user push it then the file open/download.

or

2) Download the file to your server with HttpResquest to a temp file and then use FileDisplay to you user download the file. You can use the "application/pdf" mime type.



Rubén
Fabrice Harari.pcs.crosspost
Re: Problem with generate download dialogue to download pdf file
May 02, 2009 03:52PM
Hi Vicheka,

As far as I know, for security reasons, a web site cannot access
anything on the server except it's own directory and subdirectories...
If you NEED to access something else, as seem to be the case, you'll
need your server configured differently (read rights on the directories
you need, by example)

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on [www.fabriceharari.com]


vicheka wrote:
> Dear everybody,
> I have a problem with this please help:
> First, I develop on webdev and now i create a button to read the pdf file and another button to download pdf file and for the button read pdf file it is now ok but for button to make a download Dialogue for user to download the pdf still not ok yet and in order to do this i found that in webdev already have the function to do this:
> FileDisplay(...); however, it needs the complete exact path. For example,
>
> FileDisplay(CompleteDir(fWebDir()) + "install_reel.pdf", "application/unknown","install_reel.pdf")
>
> yes this code is ok it can generate a download dialogue but you know for my case for the path to download the pdf is taken from database and the path looks like this: "[192.168.100.3]; (not real just an example) and thus i try test this case as following line:
>
> FileDisplay("[192.168.100.3];, "application/unknown","install_reel.pdf")
>
> But it is not working and gives the error as following:
> Impossible d'ouvrir le fichier <C:\AKOS_TP_WEBSITE\Exe\http:\192.168.100.3\akostp\pdf\install_reel.pdf>.
>
> Do you have any ideas please give me? Please help....
>
> Best Regards,
> Vicheka
>
Message forwarded from pcsoft.us.windev
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: