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

Camera to Database.

Hi Joe,

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

Joe6207668
Posts: 0
Joined: Wed Sep 04, 2013 6:24 pm

Camera to Database.

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

Joe6207668
Posts: 0
Joined: Wed Sep 04, 2013 6:24 pm

Camera to Database.

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Camera to Database.

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

Joe6207668
Posts: 0
Joined: Wed Sep 04, 2013 6:24 pm

Camera to Database.

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Camera to Database.

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.

Joe6207668
Posts: 0
Joined: Wed Sep 04, 2013 6:24 pm

Camera to Database.

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Camera to Database.

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.

Joe6207668
Posts: 0
Joined: Wed Sep 04, 2013 6:24 pm

Camera to Database.

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Camera to Database.

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.

Return to “Issues”