Page 1 of 1

Problem with image loading to Files collection

Posted: Mon Feb 09, 2015 4:08 pm
by Kah Wee

I have been following this tutorial: http://devcenter.appery.io/tutorials/...,

and I have hit an issue. I have selected 2 files to be uploaded into the Files collection, however, only 1 file was uploaded. (I selected the "multiple" button as well)

I tried the tutorial this morning but it worked fine, however it is not working now (I tried to apply this solution on top of the tutorial).

I tried to restart the tutorial from scratch again, but the file uploading problem seems to persist.

Appreciate your comments on this. Thank you.


Problem with image loading to Files collection

Posted: Mon Feb 09, 2015 4:34 pm
by Evgene Karachevtsev

Hello Kah,

Could you please clarify, do you get any errors in a browser console?


Problem with image loading to Files collection

Posted: Mon Feb 09, 2015 5:10 pm
by Kah Wee

Hi Evgene,

No, there were no errors thrown on my browser. I retried the tutorial again (in a new app), and the multiple file upload worked fine.

However, what I did find out was the solution for this question (https://getsatisfaction.com/apperyio/...) does not work any more, especially this line of code (from Yurii):

for(var i = 0; i < data.length; i++){
//here you can use "data.success.filename" as you need.
alert("filename[" + i + "] = " + data.success.filename);
};

After I applied this code, I was unable to upload multiple images. Even after removing the code, the issue persists.

======
My eventual goal is to be able to use a unique identifier to link the Files collection and custom file details collection. Is there a better way to do this?

Thank you!


Problem with image loading to Files collection

Posted: Tue Feb 10, 2015 4:20 am
by Yurii Orishchuk

Hi Kah,

Tried that code:

pre

for(var i = 0; i < data&#46;length; i++){
&#47;&#47;here you can use "data&#46;success&#46;filename" as you need&#46;
alert("filename[" + i + "] = " + data&#46;success&#46;filename);
};

/pre

Works correctly.
Details about implementation: http://prntscr.com/639oqu/direct

Please open browser network tab and find upload request there and see all request parameters and response.

Regards.


Problem with image loading to Files collection

Posted: Tue Feb 10, 2015 4:17 pm
by Kah Wee

Hi Yurii,

Thank you. I managed to figure out the errors from browser network tab. The code works as expected.