PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WEBDEV 23 → [WB23] FileDisplay on WebDev
[WB23] FileDisplay on WebDev
Started by ARV, Nov., 13 2018 9:57 PM - 11 replies
Registered member
279 messages
Posted on November, 13 2018 - 9:57 PM
Hi

I have this code:
FileDisplay(sDescarga,"application/unknown",sDescarga)


With this I can download and open my file when I'm on testing mode.
But if I compile and do it from a server, it download the file but it cannot open the file.

I try it with this:
ShellExecute(CompleteDir(fWebDir())+sDescarga)


I tought it coulf work but no it doesn't

also all of this code are on browser, this browser have the name and extension of my files to download, when I download the file I close the tab.

any idea?
Thanks!.

--
Best Regards
ARV
Registered member
877 messages
Popularité : +3 (3 votes)
Posted on November, 14 2018 - 11:46 AM
Hi, be carreful : ShellExecute(CompleteDir(fWebDir())+sDescarga) Will lauch the application ON THE SERVER not on the CLIENT.

What to you mean by :
" it download the file but it cannot open the file."
Registered member
279 messages
Posted on November, 14 2018 - 2:19 PM
Hi François C.

yeah I thought about that it will open on the server, I want it to be open on the client.

François C. wrote:
Hi, be carreful : ShellExecute(CompleteDir(fWebDir())+sDescarga) Will lauch the application ON THE SERVER not on the CLIENT.

What to you mean by :
" it download the file but it cannot open the file."



all I mean it's to download the file from the server and then it open to the user (client)

the part to download it works now I want to open the file from code but on the computer of the user, the file it's always on download files.

thanks for the reply!

--
Best Regards
ARV
Message modified, November, 14 2018 - 2:21 PM
Registered member
877 messages
Popularité : +3 (3 votes)
Posted on November, 14 2018 - 2:55 PM
Ok, if you want it to open automatically when download, you need to specify the MIME type of document :

FileDisplay(sDescarga,"application/unknown",sDescarga)

can be replaced by (for PDF documents)
FileDisplay(sDescarga,"application/x-pdf",sDescarga)
Message modified, November, 14 2018 - 2:56 PM
Registered member
279 messages
Posted on November, 14 2018 - 6:24 PM
Hi François C.

Oh I see but if I want to open xls it will be something like:
FileDisplay(sDescarga,"application/x-xls",sDescarga)


or is it different?

I search a little but I'm not sure:
https://help.windev.com/en-US/…

--
Best Regards
ARV
Registered member
279 messages
Posted on November, 14 2018 - 6:31 PM
Hi I try this code:
FileDisplay(sDescarga,"application/x-pdf",sDescarga)


it doesn't open the file, it only download it.
also this code is in another page, I open this page in another tab of the browser then when it's on the web user side, then I close the tab, I'm not sure if this could affect the process to open it.

--
Best Regards
ARV
Registered member
877 messages
Popularité : +3 (3 votes)
Posted on November, 15 2018 - 12:07 AM
The opening of documents is a setting under your webbrowser.
You cannot FORCE the website to open a document
Registered member
279 messages
Posted on November, 15 2018 - 2:27 PM
Hi François C.

Thanks for the reply!
I will see this setting, and I will tell you if it works and if I found them.

--
Best Regards
ARV
Registered member
87 messages
Posted on December, 11 2018 - 4:11 PM
hi,

just left out the third parameter

FileDisplay(sDescarga,"application/x-pdf")


meikl :)
Registered member
877 messages
Popularité : +3 (3 votes)
Posted on December, 14 2018 - 10:01 AM
The 3rd parameter is just to rename the file for the client, nothing more.
Registered member
87 messages
Posted on December, 18 2018 - 3:41 PM
just read the help:

: Optional character string

    Name of file to save if the Web user wants to download the file onto his computer. If this parameter is specified, the file download is automatically proposed.


look at the last sentence :)
Registered member
279 messages
Posted on January, 02 2019 - 10:45 PM
Hi all

meikl wrote:
just read the help:

: Optional character string

    Name of file to save if the Web user wants to download the file onto his computer. If this parameter is specified, the file download is automatically proposed.


look at the last sentence


That means the file will show up for the user? or it only show to where to save the file on the client side?

thanks for all of the replys

--
Best Regards
ARV