Page 1 of 3
Retrieve specific files from Files Collection
Posted: Tue Feb 04, 2014 1:26 pm
by Steve Burton
I have successfully managed to add files to the Files collection using your Documentation / Tutorial. However, I can find no way of retrieving specific individual files from the Files Collection and displaying them other than to manually find the file_name column value and create an html string such as View File. How can I query these files and retrieve the file_name so that I can create a javascript event to build the html for specific files?
Retrieve specific files from Files Collection
Posted: Tue Feb 04, 2014 2:05 pm
by Kateryna Grynko
Retrieve specific files from Files Collection
Posted: Tue Feb 04, 2014 2:40 pm
by Steve Burton
Hi Katya
Thanks for getting back to me.
I understand how to use 'where' but I don't understand how to get the file_name when I upload the file and the row is created within the Files collection. The file_name appears to be a long number followed by the original file name. How can I save the file_name when I upload the file?
Retrieve specific files from Files Collection
Posted: Tue Feb 04, 2014 8:24 pm
by Steve Burton
Hi Katya
I have managed to find a solution using:
localStorage.setItem('db_file_url',data.fileurl);
I can now upload files successfully and get the URL for accessing them into a local storage variable, however, the files are either blank pages or are corrupt when uploading standard PDF files. Any ideas how to fix this?
Thanks in advance
Steve
Retrieve specific files from Files Collection
Posted: Tue Feb 04, 2014 9:11 pm
by Maryna Brodina
Hello! You have only PDF files broken while uploading or there are another files? Have you tried to upload short .txt file or image?
Retrieve specific files from Files Collection
Posted: Wed Feb 05, 2014 7:22 am
by Steve Burton
I have testing uploading by uploading a one line .txt file and it works. I have tried uploading a 20kb .jpg file and is doesn't work
Retrieve specific files from Files Collection
Posted: Wed Feb 05, 2014 7:20 pm
by Maryna Brodina
Hello! Could you give us direct link to broken uploaded files (image or PDF)?
http://docs.appery.io/documentation/b... (see Direct link to a file)
Retrieve specific files from Files Collection
Posted: Thu Feb 06, 2014 9:42 am
by Steve Burton
Hi Maryna
Below is an example of a PDF file that was uploaded and this was the URL that I retrieved/stored at the point of upload.
https://api.appery.io/rest/1/db/files...
Regards
Steve
Retrieve specific files from Files Collection
Posted: Thu Feb 06, 2014 8:39 pm
by Maryna Brodina
Hello! Looks like you've done some mistake. Please follow the tutorial and check. If it still doesn't work give us your public app link and steps to reproduce.
Retrieve specific files from Files Collection
Posted: Fri Feb 07, 2014 8:34 am
by Steve Burton
What have I done wrong. I have followed the tutorial and it works for .txt files just not for .pdf files. I cannot see what else I can do to fix this. Please help?