on 12-03-2009 10:12 AM
Hi,
I have a requirement where i have to upload a file and have to restrict the user from uploading the file size more then 100Kb.
How can i achieve this.
Try checking the size of the data xstring of the FileUpload component. The xstring consists of the file content in Hex.
This code will find the number of hex characters in the xstring:
-
(import FileUpload data context attribute with name "filedata")
DATA: length TYPE I.
DATA: datastring TYPE STRING.
datastring = filedata.
length = STRLEN( datastring ).
-
You should be able to determine the file size from the length of the xstring and stop the user from proceeding if the size is too large.
Each hex character in the xstring represents 4 bits.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pankaj,
you might have a look at SAP Note [31395|https://service.sap.com/sap/support/notes/31395] "System parameters: Defined where? Displayed how?"
Best regards,
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pankaj,
it is possible to restrict the size for files uploaded with FileUpload. Adjust parameter icm/HTTP/max_request_size_KB to a value you expect to be sufficient for your needs.
Best regards,
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, there is no parameter that would allow the ICM to control this per application. You would have to check the size on the server as was also suggested - however this is actually a little bit late if you want to avoid the impact on the system of a large file upload. By the time you check in ABAP in the server event, the file is already completely uploaded and in session memory. The nice thing about hte ICM profile is that it checks the estimated request size and can reject the request before processing the upload itself.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.