|[2.0] How Use File after uploaded it ?||jhon dho||12/13/12 7:33 AM|
i did not find my hapiness in all questions....
Today, i know how to upload files on my site but i do not know how to use it after it is uploaded.
When The file is uploaded i copy it in "public/images" folder. But when i go to http://www.mysite.com/assets/images/file.txt , the url is not found and i have to restart my site.
Do you know a method which will give me the possibility to use the uploaded file?
Thanks for you help!
|Re: [2.0] How Use File after uploaded it ?||James Roper||12/13/12 6:26 PM|
Play doesn't make it easy for you to do this because it's not a very good way to do things, it is unreliable, it doesn't scale, and there are security concerns. You should store the file in a database or on an external hosting provider like S3.
If you really want, you can write your own assets controller that can serve files that you've uploaded from the file system.
|Re: [2.0] How Use File after uploaded it ?||jhon dho||12/15/12 12:11 AM|
Thank you for you answer.
If I want store it in data base, i have to use , blob type?
And what i have to do in order to display the image (in bacground for example)?
Thank for you help again!!
|Re: [2.0] How Use File after uploaded it ?||Robert Hoff||2/21/13 2:52 PM|
If interested in an implementation of a custom-made controller for this purpose, there is some code here that does as such - http://stackoverflow.com/questions/15006542/play-2-1-cant-access-uploaded-image-until-server-restarted
|Re: [2.0] How Use File after uploaded it ?||jhon dho||2/24/13 11:51 AM|
Thank you , it's exactally that i want!