Page 6 of 9

Camera to Database.

Posted: Fri Oct 11, 2013 7:38 pm
by Kateryna Grynko

Hi Joe,

Please take a look at here: http://docs.appery.io/tutorials/uploa...


Camera to Database.

Posted: Sat Oct 12, 2013 3:55 pm
by Joe6207668

Hey Katya,

Ok so no built in database service for the files collection, I would need to use the custom javascript from the tutorial.

Do you think it would be easier to run a query service on the files collection using custom javascript for related images, or somehow find a way to automatically load pictures in both the files collection and related collection (picture collection), then run a built in query service on the picture collection for related images?

Thanks!
Joe


Camera to Database.

Posted: Sat Oct 12, 2013 4:00 pm
by Joe6207668

I understand btw we could manually, one at a time, insert the picture names from the files collection into the pictures collection.

However ideally I would like the names to automatically store in the picture collection as well as files collection upon upload, if it is possible.

Thanks again,
Joe


Camera to Database.

Posted: Mon Oct 14, 2013 3:06 pm
by Maryna Brodina

Hello! File name is an obligatory parameter, but Appery.io can add unique guid for each file. It's enough to specify any file name, for example just "file". Then names of uploaded files would be this format code<GUID>&#46;file/code


Camera to Database.

Posted: Mon Oct 14, 2013 3:26 pm
by Joe6207668

Maryna,

Thanks for the response. Could you clarify how exactly I would use this?

Meaning at what point in my application would I include this code?

I'm not familiar with GUID

Thanks,
Joe


Camera to Database.

Posted: Mon Oct 14, 2013 4:50 pm
by Maryna Brodina

code<GUID>&#46;file/code is not the code you need to add, it's just file name format in Files DB.
[quote:]I would like the names to automatically store in the picture collection[/quote] it can't be done automatically, you can only write JS which inserts the picture name from the Files into the pictures collection while image uploading.


Camera to Database.

Posted: Mon Oct 14, 2013 7:38 pm
by Joe6207668

Maryna,

Great thanks I understand more clearly now.

So how do you recommend formatting the js code with GUID while uploading?

Should it be added to photo_buffer or photo request parameter in mapping?

Thanks,
Joe


Camera to Database.

Posted: Mon Oct 14, 2013 8:29 pm
by Maryna Brodina

Joe, sorry for confusing you. It's not really GUID, it's just a set of unique numbers which are added to file name after the file has been loaded to DB. There is only one way to retrieve this full file name - it returns in response of service you use to add files to DB. You can map that response to localStorage, then map localStorage to service for adding files to collection.


Camera to Database.

Posted: Tue Oct 15, 2013 3:25 pm
by Joe6207668

Maryna,

Great! That makes way more sense now!

I'll try it out and let you know. As of now my picture album works correctly. So until it gets too many files and starts acting slow, I think I'll just use the one collection and not the file collection.

The only sad part about my picture album is its one by one vertical listing, instead of a cool photo swipe looking album..... Any easy suggestions for horizontal and vertical listing and providing a swiping mechanism for photos?

Thanks again,
Joe


Camera to Database.

Posted: Tue Oct 15, 2013 8:55 pm
by Maryna Brodina

Hello! You can use photoswipe in your app. Here is an example http://docs.appery.io/tutorials/addin.... But you would need to specify images names not manually as described in example, but on service success event retrieve all images from response and transmit them to photoswipe.