Graeme6630509
Posts: 0
Joined: Sun Feb 02, 2014 5:26 pm

Unable to upload image to custom collection

Hi Yurii,

It is the unique "file name" in the files collection that I am looking to get. I then have a file details collection where I will use the file name as a reference to the file.

Thanks,
Graeme

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Unable to upload image to custom collection

Hi Graeme,

I am sorry, not sure I understand whether this is what you need. Please let us know if you need our help.

Graeme6630509
Posts: 0
Joined: Sun Feb 02, 2014 5:26 pm

Unable to upload image to custom collection

Hi Kateryna,

I am looking to store a file and some details about the file to the database. e.g. a profile photo(file), firstname, surname.

From what I am aware I have to store the file to the files collection.
I have also created a details collection to store the firstname and surname.

What I want to do is link the two collections via a unique identifier.

Is this possible or am I going about it the wrong way?

Thanks,
Graeme

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Unable to upload image to custom collection

Hi Graeme,

Please follow these steps to get information about uploaded file:

1 Navigate to page "data" mode.

2 Add "success" event handler for your "upload" service datasource with action "Run JavaScript".

3 Populate it with following code: http://prntscr.com/4sijl2/direct

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

Regards.

Graeme6630509
Posts: 0
Joined: Sun Feb 02, 2014 5:26 pm

Unable to upload image to custom collection

Thanks Yurii,

Worked perfectly.

Thanks,
Graeme

Return to “Issues”