PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → FileDisplay
FileDisplay
Débuté par vicheka, 17 juil. 2009 10:14 - 1 réponse
Posté le 17 juillet 2009 - 10:14
Dear all,

In webdev in order to generate a download dialogue box => I have to write code like this:

FileDisplay(CompleteDir(fWebDir()) + "PDF\" + "mode_fact_seine_et marne.pdf", "application/pdf","mode_fact_seine_et marne.pdf")


Even though it could generate the download dialogue box but It requires to have full path of the file pdf and that pdf file has to be located in the server with in the site. However, if that pdf file is located in another server => This function FileDisplay are not usefull anymore because I have try to put like this:

FileDisplay("http:\\192.168.100.1\" + "PDF\" + "mode_fact_seine_et marne.pdf", "application/pdf","mode_fact_seine_et marne.pdf")


=> It could not generate the download dialogue box but instead generate ERROR:
What could I do? => Please anyone help me please
I am hopeless...

Thanks
Best Regards,
Vicheka
Posté le 15 août 2009 - 09:41
The problem is that you cannot send the file to a client that is on another server.

You have two options here...

1. Download the file from the other server using HTTPRequest, and then send it using StringDisplay... Or download it with HTTPRequest, save it with fSaveText, then use FileDisplay to send the file to the client... I won't recommend this because it would consume extra bandwith and if the file is big, a LOT of memory.

2. Open the file address using browser code: BrowserOpen("http:\\192.168.100.1\" + "PDF\" + "mode_fact_seine_et marne.pdf")

This last option will open a new browser so the user can download the file.