Uploading multiple photos in a form - php

I have a photo-upload form that allows a user to upload 1 photo. But my users are complaining that they want to upload many photos. How can I allow them to do that?
Right now I have this form for uploading:
http://www.hikingsanfrancisco.com/account/upload_hike_photos.php?hike_id=58
(I tried to paste code, but it didn't work somehow)
Any thoughts how to best go about it? Is there a way to loop through the selected files maybe? (I am using PHP)
Thanks,
Alex

Add more fields for uploading files, I don't know, maybe file or six, and the upload button will check through php which of them have information to start the upload, 1 at a time or course, in a php loop.

Here is a plugin that uses flash + javascript (MooTools) to do file upload. The upside to this plugin is that it's supported and you can Github it. It can have multiple photo uploads, limit max size, etc, and verify file information before upload. Also, has example for backend using PHP on how files are handled after it is uploaded.
Fancyupload
Features
Select and upload multiple files
Filter files by type in the select
dialog A lot of possible Events to
add your own behaviour
Show and filter useful file information before
the upload starts
Limit uploads by file count, type or size
Platform and server independent, just needs Flash9+ (> 95% penetration) which works on all browsers with it installed
Here is the jQuery plugin that does the same as the MooTools one:
Uploadify

Add new file inputs. Or use smth like swfuploader for file uploading.

Related

Plupload Image Upload preload images OR add images programmatically

I am using Plupload to allow users to upload images in a form. I am able to successfully upload images using Plupload. My program also allows users to save the form and continue editing/posting later. Now when the user resumes the form later I want to pre-load those files in Plupload from the server. I am not sure how to implement this.
I have been trying to implement addFile, but cannot implement. I would like to preload or add files to plupload programmatically.
Link:
Add File Method
Your help would be appreciated!

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.

Php Multiple Instance Upload Files at once on submit with Process On Second Page With Progress Bar

Sorry for my English, I had to use Google Translator
I have a form, in this form i have several input upload files.
What I'm trying to do is send the arquives at once to the next page. When its happen it darkens the page and shows a progress bar where it sends all files. Once you do it finishes recording in the database.
The files uploads is multiple instances
Found I multiple file uploads but no causes that I am wanting to do and do not know what I can do to get this result.
I can't use XMLHttpRequest but i can use APC
I do check the size and types of archives (PDF, JPG, ZIP)
I have an image that explains itself, see the link
Picture
Beside the fact that you cant use XMLHttpRequest, any ajax solution can't be used. But in my eyes this works only with ajax.
I recommend you to check out uploadify. There are several events fired on upload start and while uploading the file(s). Just take a look to the documentation! Also you can upload multiple files at once, without having several inputs for file uploading.
You can make on upload start (once, just set a var on upload start of the first file to true or something else, what indicates, that the upload has started) show a overlay-div with HTML-elements that simulate a progressbar. This progressbar can be updated by javascript while uploading. Uploadify should give you all information about the files and amount of bytes.
The upload and database part is handled by a php-file which can be specified by you.

Drag and drop files to be uploaded when the form is submitted

I'm trying to implement drag-and-drop file selection for uploading files synchronously once the form is submitted. I know how regular file uploading works with HTML and PHP. And I want to be able to process the files in PHP alongside the ones in the $_FILES array.
I've done some research and looked at several plugins but pretty much all of them either upload files once they're dropped into the window or don't use conventional html forms.
Any kind of help like ideas, snippets or plugins would be appreciated.
Thank you!
It is impossible to set the files attribute of a file input via JavaScript for security reasons. See this jsfiddle.
So, you cannot select files for a file input via drag and drop, you have to select the files via the file input directly, by clicking on the 'browse files' button.
What you can do is to implement an onUpload method for the form, to upload the files when the user clicks the submit button, via AJAX. Then, when the uploads are completed, you submit the form with the other data.
See this fiddle to see how to upload files via AJAX. The code has the drag and drop processing and converting binary files into BASE64. You will need to create the AJAX bit by posting the data. To check if the files are done, create a function to be called with setInterval, to check if all the uploads completed.
Cheers,
Apoc

Uploading and Styling File With PHP and Jquery

I have a form where the admins will be uploading more then 2 pictures at a time, i had been using the basic HTML file input style, however i want to do more with it as i am using a beautiful admin theme from themeforest, (the author haven't included the styled file input element in skin), i want to do it manually. which should meet the following requirement
a) A styled file input element should
be displayed first
b) When the user gives the file input
it should automatically upload the
file using php
c)while uploading the file i want to
see the file upload progress with tool
tip
d)once all the files are uploaded the
user should be able to process the
form with already uploaded file.
I want to admit that i have a very basic understanding of how javascript and Jquery works, however i am quite good at PHP, HTML and CSS.
I want some kinda tutorial regarding how do i style my file input to fill my need.
i am searching something like this.. File Upload
thank you
The only thing that fulfills all your requirements in a way that works with most browsers at the moment is a Flash-based uploader like SWFUpload or Uploadify.
Use SWFUpload. Look its FEATURES DEMO. It has almost everything.

Categories