PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WEBDEV 23 → [WB23] FileDisplay on WebDev
[WB23] FileDisplay on WebDev
Iniciado por ARV, nov., 13 2018 9:57 PM - 11 respostas
Membro registado
280 mensagems
Publicado em novembro, 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
Membro registado
878 mensagems
Popularité : +3 (3 votes)
Publicado em novembro, 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."
Membro registado
280 mensagems
Publicado em novembro, 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
Mensagem modificada, novembro, 14 2018 - 2:21 PM
Membro registado
878 mensagems
Popularité : +3 (3 votes)
Publicado em novembro, 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)
Mensagem modificada, novembro, 14 2018 - 2:56 PM
Membro registado
280 mensagems
Publicado em novembro, 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
Membro registado
280 mensagems
Publicado em novembro, 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
Membro registado
878 mensagems
Popularité : +3 (3 votes)
Publicado em novembro, 15 2018 - 12:07 AM
The opening of documents is a setting under your webbrowser.
You cannot FORCE the website to open a document
Membro registado
280 mensagems
Publicado em novembro, 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
Membro registado
87 mensagems
Publicado em dezembro, 11 2018 - 4:11 PM
hi,

just left out the third parameter

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


meikl :)
Membro registado
878 mensagems
Popularité : +3 (3 votes)
Publicado em dezembro, 14 2018 - 10:01 AM
The 3rd parameter is just to rename the file for the client, nothing more.
Membro registado
87 mensagems
Publicado em dezembro, 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 :)
Membro registado
280 mensagems
Publicado em janeiro, 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