PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WEBDEV 24 → [WB23] FileDisplay on WebDev
[WB23] FileDisplay on WebDev
Iniciado por ARV, 13,nov. 2018 21:57 - 11 respuestas
Miembro registrado
373 mensajes
Publicado el 13,noviembre 2018 - 21:57
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
Miembro registrado
1.042 mensajes
Popularité : +3 (3 votes)
Publicado el 14,noviembre 2018 - 11:46
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."
Miembro registrado
373 mensajes
Publicado el 14,noviembre 2018 - 14:19
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
Mensaje modificado, 14,noviembre 2018 - 14:21
Miembro registrado
1.042 mensajes
Popularité : +3 (3 votes)
Publicado el 14,noviembre 2018 - 14:55
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)
Mensaje modificado, 14,noviembre 2018 - 14:56
Miembro registrado
373 mensajes
Publicado el 14,noviembre 2018 - 18:24
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
Miembro registrado
373 mensajes
Publicado el 14,noviembre 2018 - 18:31
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
Miembro registrado
1.042 mensajes
Popularité : +3 (3 votes)
Publicado el 15,noviembre 2018 - 00:07
The opening of documents is a setting under your webbrowser.
You cannot FORCE the website to open a document
Miembro registrado
373 mensajes
Publicado el 15,noviembre 2018 - 14:27
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
Miembro registrado
87 mensajes
Publicado el 11,diciembre 2018 - 16:11
hi,

just left out the third parameter

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


meikl :)
Miembro registrado
1.042 mensajes
Popularité : +3 (3 votes)
Publicado el 14,diciembre 2018 - 10:01
The 3rd parameter is just to rename the file for the client, nothing more.
Miembro registrado
87 mensajes
Publicado el 18,diciembre 2018 - 15:41
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 :)
Miembro registrado
373 mensajes
Publicado el 02,enero 2019 - 22:45
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