how to make an interactive uploader like gmail and facebook have? - php

I want to make a interactive uploading option like Facebook and gmail have where they show the progress of the current file in uploading and then show the respective image or name of the file over there after the upload.
Right now, i'm using php and normal html for uploading where i send the file from one page to another where php handles it accordingly but i want a interactive one which show the progress also on the same page and then the name of the file after uploading without page refresh.
I knew, it can be done with ajax and css but i don't know how. All i want a interactive upload-er which uploads the file and then provide me the respective file name.

Gmail uses firefox file api, read more about it here https://developer.mozilla.org/en/Using_files_from_web_applications
Or check this live demo
http://robertnyman.com/html5/fileapi-upload/fileapi-upload.html
Hope this will help/solve ur problem ;) best luck

Related

how to preview uploaded image in php form

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.

running a PHP file in background

I'm building an upload files form, it works fine but now i wanna add some extra features to it, for example,
When I upload the file the page im in sends me to the PHP page, then it echo's a message saying that its done and showing a preview of the image.
What I would like to do now is to stay in the same page as the file is being uploaded, then just get a message in the same page once the file is done uploading. So in other words not be sent to the PHP page instead that info (sent via form POST) can be sent in the background (maybe using XMLHttpRequest?)
Can somebody point me to the right direction to do something like that? i would greatly appreciate it.
Thanks!
You'll have to use javascript and APC_UPLOAD_PROGRESS to monitor the upload. Like this:
http://www.ibm.com/developerworks/library/os-php-v525/index.html
HTH

Triggering a FLASH Event function

I am trying to build a simple application. The first phase is selecting to upload a file from the user desktop or from the site's gallery.
The question is if the user chose to upload from the gallery, say, go to an PHP page gallery, choose a photo and then redirected to the Flash app. How would you trigger the Flash up to know there was an image chosen and it should load it?
Does PHP send a variable or create an XML based on a choice and pass it via Flash variable, or does it need JavaScript to tell Flash that if the Flash var is not empty run this function? Could you please give a sample script I could work on?
Why are you starting the upload process outside of Flash when you want to use the file inside of the Flash application? Use FileReference to initiate the file upload, save the image name locally and have the php script you hand the file off to store the file in a known place, then listen for the Complete event. From there, you should be able to load the file into Flash from your server using the path "KnownDirectory/SavedFileName" with URLLoader.

Take picture from local video source and submit via PHP form

How would I go about taking a picture from a video capture card or webcam? Should I use flash to do this? I want to submit the picture via a php form and upload it to my webserver and place a link to it in my MySQL database. Is there a flash app already built that I can use to perform this?
try this:
http://code.google.com/p/jpegcam/

Which free tool/script i can use for user to download mp3 from website

I have one website and few mp3 in one folder fro user to download.
Is there any flash or php script which shows the content of folder in nice gui way so that user can click on them and download them
Just iterate over the content using DirectoryIterator like shown here.

Categories