Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

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

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.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

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

Hello Andy,

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

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

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

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

Return to “Issues”