cancel
Showing results for 
Search instead for 
Did you mean: 

Save file in directory after upload with fileupload-element ?

gerd_hotz
Contributor
0 Kudos

Hello experts,

I have a webdynpro where I have a fileupload-element in order to upload a

file like test.pdf.

After checking this filename I want to save this file on another directory.

How can I do this ?

Thanks Gerd

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Please specify what you mean by another directory? Do you mean another directory on the client machine (in which case you would use the fileDownload UI element or the attach_to_response API) or another directory on the application server or another directory in the MIME repository?

gerd_hotz
Contributor
0 Kudos

Hello Mr. Jung,

I use the ui-element fileupload in order to upload a file from the local machine.

Then I check if the name-convention of this file is correct, and after

this check is ok, I want to upload the file to directory of our network in our company.

Now I want to know how I can do this ? Is there a fm where I can use ?

Thanks Gerd

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Even thought you are just checking the file name conventions, you already have the file content in memory on ABAP after the fileUpload operation. You say you want to write this to a directory of your Network. You are going to have to provide more details on where this directory is and how it might or might not be connected to your ABAP application server.

If this directory can be mounted to the file system of your ABAP application server than you can just do normal ABAP DATASET commands to write the content out to it. If it is not directly mounted, then you would have to look at using something like FTP. ABAP has function modules for doing FTP (in the function group SFTP).

If there is no way to access the directory from ABAP, then you would have to rely upon the the fileDownload. The user would have to manually select the correct location of where to save this file and would have to have authorization to write to this directory. ABAP would really only be sending the content back to the browser and the client machine/user would be doing the rest of the work.

pranav_nagpal2
Contributor
0 Kudos

Hi,

Refer this link, Uday has explained the the process in detail...

regards

Pranav