on 01-09-2015 1:26 PM
Hi experts,
I'm trying to import an excel file into a table using the FileUploader control.
For that i need to send the table content to the backend together with the file.
I saw there is a property parameters[] in this control, but i don't really get it how to use it.
In the "change" event from the control, I'm trying to add some parameters, but it doesn't accept them with fileUploader.addParameter("someContent")
What kind of values does this method accept?
and what is the best way to send some data to the backend through the fileUploader control?
Regards,
Georgi
The problem was that we are using an older version of the sapUi5 library.
The sap.ui.unified.FileUploaderParameter is since version 1.21.0. and with versions below we need to use the sap.ui.commons.FileUploaderParameter
Thanks for the help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you use the search function here, you will find a blog called "Upload Image to SAP Gateway and ...".
There you can read about how to upload a file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't have used the fileuploader yet.
But have you already read the API about that control?
addParameter
Parameters:
{sap.ui.unified.FileUploaderParameter} oParameter
- the parameter to add; if empty, nothing is inserted
So you have to give him a sap.ui.unified.FileUploaderParameter ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes i already read that, but when i try to add it like this:
uploader.addParameter(new sap.ui.unified.FileUploaderParameter(exportObject));
it thorws an error that : Uncaught Error: "[object Object]" is not valid for aggregation "parameters" of Element sap.ui.commons.FileUploader
I'll check that blog,
thanks!
So then there is another mistake. Because its working. Look here:
JS Bin No console errors ---
please share your example code at JS Bin.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.