cancel
Showing results for 
Search instead for 
Did you mean: 

File Upload-Attachments

Former Member
0 Kudos

Hello Gurus,

We have a scenario to limit the file size to 7MB and also check for a valid file format during upload for a SAP standard application.(Attachments in SC in SRM 7.0)

I understand from the various posts the limitation of Fileupload, that the file information can be retrieved only after the file is uploaded to the server and no client side eventing is possible.

We cannot use ACFupload/download or Flash Islands since we just need to create an enhancement to the standard application.

Please let me know if there is any workaround for the scenario mentioned above before the file gets uploaded to the server.

Thanks,

Bharathi.

Accepted Solutions (0)

Answers (1)

Answers (1)

gill367
Active Contributor
0 Kudos

There seems to be no way you can check the size and type of the file before uploading.

so i guess you have to validate only after upload and delete it if it is not of desired size and type.

thanks

sarbjeet singh

Former Member
0 Kudos

what about using CL_GUI_FRONTEND_SERVICES=>FILE_GET_SIZE for files located on the presentation server?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> what about using CL_GUI_FRONTEND_SERVICES=>FILE_GET_SIZE for files located on the presentation server?

You can't use any of the CL_GUI* classes within Web Dynpro. They are for SAPGUI only.

You are running in the browser, which in turn limits your access to the client side.

You can however restrict the size of the upload via the ICM. The HTTP request for the file upload does report the size to the HTTP Sever before the upload actually begins. It can be rejected at this level before data is actually transfered from client to server by setting the icm/HTTP/max_request_size_KB profile parameter. You can read more about it here:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/48/69ef8be8a607d6e10000000a42189c/frameset.htm

You should note, however, that this is a global setting and impacts all applications and all HTTP requests. Be very careful how small you set it.

Former Member
0 Kudos

Hi Thomas,

Thanks for your response...

If we go ahead with the ICM/http_max_size request approach, what is the expected system behavior?

Is there a class/Function module to catch the excpetion raised by the application server ?

Is there way to simulate the fileupload using a button and input field?

Thanks a lot for your help!!

Bharathi.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>Is there a class/Function module to catch the excpetion raised by the application server ?

No. The situation is caught by the ICM before control even passes to the ABAP work process.

>Is there way to simulate the fileupload using a button and input field?

No. This is a browser/HTML limitation, not a Web Dynpro one.

Former Member
0 Kudos

Hi Thomas,

Thanks for the quick response...

Currently in our case, the icm/http_max_size parameter has been set to 10mb.

whenever the file size exceeds 10mb, the fileupload ui element seems to be reading the duplicated file in the work process...

But, there is no file uploaded, the file input area is cleared.....

Since our whole approach is to improvise the performance,the above scenario doesnt seem to be working well...

Any Thoughts??

Thanks,

Bharathi.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You are saying it isn't improving performance.

Here is the statement from the online help:

The value of the parameter is the maximum size (KB) of an HTTP(s) request that can be forwarded by the ICM. Requests whose content length (content-length) exceeds the specified value are already rejected by the ICM.

This means that no resources are required in the backend (memory, work processes).

There still would be processing time on the client side and even network time associated since the request must be made but will be rejected by the ICM. However as pointed out in the help, the content is not processed by the ICM nor is it passed into the ABAP work process - protecting the server side resources.