cancel
Showing results for 
Search instead for 
Did you mean: 

Get the size of the file selected using FileUpload button

Former Member
0 Kudos

Hi Experts,

I used the FileUpload UI element to upload a file. Now I have a requirement to restrict the file size to 20MB when a file is selected.

Could anyone help me how do i get the filesize.

Thanks in advance...

Best Regards,

Govardhan D.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member184578
Active Contributor
0 Kudos

Hi,

As explained above, you can get the size of file after upload. If you want to restrict uploading file larger than 20MB, set the parameter icm/HTTP/max_request_size_KB

http://help.sap.com/saphelp_nw04s/helpdata/en/46/e4de6dda9d537ce10000000a1553f6/content.htm

But you should be careful to use the parameter as it is global and it reflects for all applications.

Hope this helps u.,

Regards,

Kiran

Former Member
0 Kudos

Hi Govardhan,

You can get the file size that you upload using file upload UI

wd_context->get_attribute( exporting name = 'FILE'  importing value = content ).

what ever the content ur getting to know the size write this line.


data size type i.

size = xstrlen( content ). "Pass the content ur receiving when u upload file.

This size u'll get in bytes convert it into MB or any u want.

Regards

Madhukiran M.


Former Member
0 Kudos

Thanks Madhukar.... i have already implemented this and its working .......

Former Member
0 Kudos

Hi Govardhan,

can close the thread if you have completed.

Thanks&Regards,

Madhukiran