Page 1 of 1

IONIC File Upload Plugin - change filename prior to upload or get new "assigned" filename back from service

Posted: Fri Nov 04, 2016 3:22 pm
by Andy Parker

Hi,

I've used the IONIC file upload app from the Appery plugins and am happy that this works well.

The issue I have is that I cannot see a way of changing the filename that is used in the database table prior to upload.
Also, there is no returned "new" filename by the service, so it makes it difficult to catalog the file uploaded.

So, in summary, what I need to know is:

  1. How to adjust the filename prior to upload so I can place a know identifier in the filename to refer to later, or

  2. How do I get the service to return the new filename applied by the system (i.e. the _id)

    many thanks.


IONIC File Upload Plugin - change filename prior to upload or get new "assigned" filename back from service

Posted: Fri Nov 04, 2016 8:51 pm
by Serhii Kulibaba

Hello Andy,

Upload service returns an object with two properties: "filename" and "fileurl" by default


IONIC File Upload Plugin - change filename prior to upload or get new "assigned" filename back from service

Posted: Tue Nov 15, 2016 3:31 pm
by Andy Parker

perfect, thanks.
Odd that the service does not list these properties when looking at the service listing.
I got it working as follows (assuming a single file was uploaded):
code
console.log($scope.fxresponse[0].success.filename);
console.log($scope.fxresponse[0].success.fileurl);
/code