Function Upload a file
Example <input type="file" id="content" name="content" accept="*" style="display:none">

<
button type="button" class="button"
   
onclick="S10Upload('save_attachment', 'content’, this)">
       Select and upload a document
</button>
Parameters
Nr Description
1
Method name
This ABAP method is called after the upload
2
Id of the <input> element
The file selected there by the user is uploaded
3
Anchor element for messages
As a rule, the triggering button is passed here with "this".
Description  Through S10Upload() you can enable the user to upload a local file.

After the upload, the specified ABAP method is called. The content of the file is available in the attribute named in the <input> element with name= as an x-string. You can retrieve the file name in ABAP by s10actionparameter().

The file size is limited to a maximum of 16MB.

Example:

ABAP

 data:     
    
content type xstring.


* save 
uploaded attachment
  
method save_attachment.

    
datafilename    type string,
          
filesize    type i.

    
filename s10actionparameter( ).

    
filesize xstrlencontent ).

* save 
content
  ......
   


endmethod
.

Components S10 Framework