For now, i am able to download the image that i uploaded into my server. My upload is using php script to file open a image to store the .jpg file in the server. But i want to know how to retrieve the new image from my server to my android application. What i meant is every time the user upload the image, the image will replaced the old image file (using the same file name) in my server folder.
When i reload the image in my application, it still gives me the old image even though the image not longer exist. Later i found out that i need to go the url and refresh the image then the new image will be loaded in the android application. I want to know how can i refresh the url without using the browser to refresh the image every time the user upload new image. Thanks!
My question might not be clear/good but i really needed help and im new to android development
A pragmatic approach: When the user uploads a file, also make a txt/xml-file with the current date in it.
Make you Android application poll the txt/xml-file. Store the date in the txt/xml-file (in a database). When polling verify if the date in the file is newer then the one you stored. If it's newer, download your image.
After successfully replaced on server,you have to get url of new uploaded image as response & replace old url by new url.
Related
I am new to php my question is i want the user to upload the image(from front end) and it should store in the folder i.e. in server.How can it be achieve.I know how to store the url in database.But I want to store the image in the folder which is in the server can it be achieved.
You can find out example of upload image from AngularJs front-end to server using php here: https://github.com/nervgh/angular-file-upload
I need to know the image upload date from a jpg file on another website. The image has no EXIF information (everything empty).
How can it be done? It's not my own server so I can't just use FTP.
You can only get what the server sends you, which in this case is the image data. You don't know where it got the image-data from, and you don't know when it was put there. ... Unless, by a separate request, the server gives you such information.
i created PHP form for my site, with image upload option on it.
but it only show the image name before image submitted, but i want to view/preview the image/file before submit so how this possible in this?
"file36":{"label":"Select/Upload a Student's Photo","accept":"jpg|jpeg|png|gif|bmt","files":true,"attach":true,"database":true,"maxbytes":204800,"fieldtype":"fileupload","required":true,}},
As far as I know this is not possible with php until you upload the image.
However, you are able to do so with jquery.
Check out http://blueimp.github.io/jQuery-File-Upload/
The old way is to upload the image to a temp folder, create an iframe and load the response there. Then link the temp image from the iframe to a hidden field in the final form with JavaScript. When you submit the form place the image in the right folder. Finally run a cron job every 24-48h to empty out the temp folder.
The new way is the File API supported in IE10+ and all modern browsers. Fallbacks in Flash and Silverlight exist for older browsers.
You obviously misunderstand how file uploads w/ PHP work.
PHP is server side programming language, meaning, it can only execute and access scripts, that are on the server. So, for PHP to access / analyze a picture in any way, it has to be on the server already.
You can upload the file in a temporary directory, analyze it and, if it suits your needs, move to a permanent folder. Otherwise, just delete it.
Setting up a live image stream on a website, using images from a webcam. Trying to work out the implementation of it. The webcam takes a picture and requires a crop, resize and upload (not necessarily in that order), before it is displayed to the user, with a new image every minute. Currently I have a php script that does the cropping and resizing, while a webcam program automates the picture taking and uploading. However...
Uploading directly over the existing image causes an issue if the user reloads the page while the upload is taking place, resulting in a missing image.
Uploading with a different filename, then renaming it causes an issue if the user reloads the page during the renaming, resulting in a combination of both images.
Using a sequential filename system then gets tricky with the webpage requiring to know the new upcoming file every minute, along with a potential backlog of images.
Any suggestions are appreciated. Hopefully I'm missing something simple.
Thanks.
Just upload your image with different name, set the current image name somewhere, either in config file or MySQL, and after upload change it.
I have a script where by users upload an image on a website and the image gets uploaded to an FTPServer. The name of the file is stored in a database, so when users click on a link, the query string is used as a reference in the Database to get the image name. The only part I'm stuck on right now, is how to display the image on my webpage using php. Is there a specific function to get a copy from the FTP server and display the image? I dont want do download the image to the web server, and then display the image and then delete it, as this could take up a lot of space if the web site has many visitors.
The "big image hosts" typically have web access to their "storage servers" as well. So when a file is uploaded to their image server it's accessible with a URL. You'd want to determine the url that points to the file you just uploaded and place that in your html (in the img tag. Let the user's browser retrieve the image, as opposed to your web server first retrieving it and then displaying the page.
You have to store the image on the web server, once you do that you can display it on your web page however you like, php, ajax, javascript, your choice.