Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Cant upload files with Upload plugin

Forget it. I will make another plan.

leven.steve
Posts: 0
Joined: Sun Mar 04, 2012 4:01 pm

Cant upload files with Upload plugin

The UploadAll function returns true (ie success is called) even if NO files were successfully uploaded.

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

Cant upload files with Upload plugin

Hello Steve,

Could you clarify, which function do you use?
Please use events "success" and "error" of the upload service to check it's result

leven.steve
Posts: 0
Joined: Sun Mar 04, 2012 4:01 pm

Cant upload files with Upload plugin

In your example plugin (which you are "fixing") it is suggested elsewhere on this forum to use the Upload All button. This does work however your documentation states that you will get a Success response so long as one of the possible multiple files are uploaded.

What I have found is that if you add say 3 files to the list and then click Upload All and none of them get uploaded (maybe they have spaces in the name for example) then you still get a Success response so it calls your Success() function after the "post" function call. So it then says "Files uploaded succesfully".

I dont think I can explain it any better really...

leven.steve
Posts: 0
Joined: Sun Mar 04, 2012 4:01 pm

Cant upload files with Upload plugin

Would you like to see the entire function code?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Cant upload files with Upload plugin

Hello Steven,

Sorry for the radio silence here. Sure, we would like to see it, could you please share it with us?

leven.steve
Posts: 0
Joined: Sun Mar 04, 2012 4:01 pm

Cant upload files with Upload plugin

I think I can clarify this. What I have discovered is that the upload function call
code Apperyio.get("FileDB__files_upload_service")(requestData).then(/code
always triggers the function(success) call back but the returned "success" variable will indicate whether an error occurred or not.
Image

Your sample code then says "All files has been successfully uploaded." without checking the error code!

What I was expecting is that the function(error) would trigger instead.

So if you are re-writing this sample you might want to amend it or at make that clear in the documentation for the plugin please.

leven.steve
Posts: 0
Joined: Sun Mar 04, 2012 4:01 pm

Cant upload files with Upload plugin

As an aside this, anyone who wants to use the code and work around the problem of spaces in the file name can use this line in the requestData mapping/setting code to replace all spaces with %20 or change the %20 to a dash or underline.
coderequestData.data = _.pluck($scope.files, 'filepointer');
for(var i=0;i<1;i++){requestData&#46;data&#46;name=requestData&#46;data&#46;name&#46;replace(/ /g,"%20");}/code

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Cant upload files with Upload plugin

Steve,

Thank you for the feedback, we'll forward this information to our development team.

ian H
Posts: 0
Joined: Thu Mar 31, 2016 6:14 am

Cant upload files with Upload plugin

Deon,

I have the same issue. Did you find a solution?

Best,

-I

Return to “Issues”