Download documents

Download documents

  


Hi,

I have a problem, I need to open documents (pdf) that are on the internal network. The path to the document is in a database.
1 - in the server action "preparation" I get a list with the path and document name "\\ xxxx \ yyy \ zz.pdf"
2 - in a "modal" i list the result obtained in 1
3 - each record has a button that when clicked performs action 4 (next)
4 - action that executes a get to the registry clicked followed by a download with the option "Save to disk" = Yes

Problem:
when trying to open the document, it appears with the path "xxxxyyyzz.pdf", ie all "\" are removed.
I tried to duplicate the "\\" as well as replace "\" with "/ \" but without any result.

Can anyone help?

Thank you
Carlos Messias

Hello,

Backslash is not valid character for cross-platform file names.

Is the file name your problem? Or do you want to get the file that is on the directory?

If the problem is the 2nd then i believe in step 4 you need to use the path \\ xxxx \ yyy \ zz.pdf to go to the file system of the server so you can read the binary data of the file.


Steps:

0. Install FileSystem from the forge

1. Reference FileSystem lib, File_ReadBinary action.

2. Use the action with the path you have

3. Use the download widget with the retrieved binary

Kind regards,

Márcio Menezes

mmenezes wrote:

Hello,

Backslash is not valid character for cross-platform file names.

Is the file name your problem? Or do you want to get the file that is on the directory?

If the problem is the 2nd then i believe in step 4 you need to use the path \\ xxxx \ yyy \ zz.pdf to go to the file system of the server so you can read the binary data of the file.


Steps:

0. Install FileSystem from the forge

1. Reference FileSystem lib, File_ReadBinary action.

2. Use the action with the path you have

3. Use the download widget with the retrieved binary

Kind regards,

Márcio Menezes

Hi Marcio

I'll test your suggestion and then let you know
Thanks 


Hi Marcio 

I'm testing your suggestion, however when the Fie_readBinary server action is invoked, I get an exception with the message "Logon failure: unknown user name or bad password."
Any idea to solve this problem?

best regards

Hello,

The solution above only works if:

1. The file is in the same server as the server running your code

2. IUSR has permission to read the file

Can you confirm this?

If the file is not on the same server then this solution will not work.


Kind regards,

Márcio Menezes

mmenezes wrote:

Hello,

The solution above only works if:

1. The file is in the same server as the server running your code

2. IUSR has permission to read the file

Can you confirm this?

If the file is not on the same server then this solution will not work.


Kind regards,

Márcio Menezes


Hi Marcio

The files are actually on another server.
Is there any way to open the documents?
In practice, what I need is to be able to read the documents in the same way I can with the documents in the resources.

Thank you