Form having more than one file input not submitted - php

Actually I having one form will four File Input text box (Like Below).
While Submitting form means it is not sending data to server. When i seeing in console that status still in pending(See Below).
Don't why it is happening. Please Kindly help me to over come from this.
This Is my Code:
<form action="file.php" enctype="multipart/form-data" method="post">
Upload 1 <input type="file" name="file1"><br>
Upload 2 <input type="file" name="file2"> <br>
Upload 3 <input type="file" name="file3"> <br>
Upload 4 <input type="file" name="file4"> <br>
<input type="submit" value="Submit">
</form>
Thanks,

Related

problem with enctype="multipart/form-data" in submitting mixed content (files and text)

i have problem with enctype="multipart/form-data".
<form action="insert_data_script.php" method="post" enctype="multipart/form-data">
<!-- FILE INPUT -->
<input type="file" name="fileInputName" id="fileToUpload">
<!-- TEXT INPUT -->
field 1 :<input type="text" name=text-1>
field 2 :<input type="text" name=text-2>
<input type="submit" value="send" name="submit">
What happens with me is this:
when i delete enctype="multipart/form-data", the submit of text inputs (text-1,text-2)
run successfully, and the submit of the file fails!.
when i keep enctype="multipart/form-data".the opposite case happens:
the submit of text inputs fails, and the submit of the file run successfully!
Any idea what's going on???
and how to fix it??
i am using :windows 7 64bits, firefox developper 85.0.2 64bits wampserver2.5-64bits/Apache-2.4.9/Mysql-5.6.17/php5.5.12/

HTML form - keep reference to uploaded file for 2 button options

I have an html form and 2 php files, all of which work well. In the form I created a preview button that references a php file that shows the uploaded cvs in an html table as a preview. The submit button inserts it into a database.
I would like to have the form contain one button that goes to the preview page and once the info is confirmed, there would be another button that references the submitted file, but I can't seem to get that to work.
Due to the environment I'm trying to get this to work without javascript or ajax if possible, as another user gave me a javascript option.
Here is the html form:
<form method="post" action="confirm.php" enctype="multipart/form-data">
<label>Upload File</label>
<input type="file" name="file">
<input type="submit" name="submit" value="Confirm" >
</form>
<form method="post" action="upload.php" enctype="multipart/form-data">
<label>Upload File</label>
<input type="file" name="file">
<input type="submit" name="submit" value="Submit">
</form>
Each Php file corresponds as well:
if(isset($_POST['submit']))
Is there any way to go from upload to preview to submit and keep reference to $file?

How to upload multi files to amazon S3 directly with the form data?

There is a form at the front-end like this to allow user insert a video list record.
<form action ="" method="post" enctype="multipart">
<input type="file" name="files[]">upload1
<input type="file" name="files[]">upload2
<input type="file" name="files[]">upload3
<input type="file" name="files[]">upload4
<input name="list_name" />
</form>
each record has at least 2 video files , and 4 files at max.
The problem is ,
From the offical tutorial,
https://github.com/aws/aws-sdk-php
The file is temporary store at my server before upload to s3 , I wonder how to upload directly to s3 in PHP ( or code-igniter )? Also post the 'list_name" to my server before start upload to s3 ?
Thanks a lot for helping.
The only way is to use multiform
<form action ="" method="post" enctype="multipart">
<input type="file" name="files[]">upload1
</form>
<form action ="" method="post" enctype="multipart">
<input type="file" name="files[]">upload2
</form>
<form action ="" method="post" enctype="multipart">
<input type="file" name="files[]">upload3
</form>
and upload using jquery upload plugin

PHP Multiple File upload - some form variables omitted after selecting too many (large?) files?

I have a very basic PHP multiple file upload form:
<form action="file.upload.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?php echo $_REQUEST['id']; ?>" />
<input type="hidden" name="bypass" value="1" />
<input multiple type="file" name="file[]" id="file">
<input type="submit" name="submit" value="Submit">
</form>
Everything works fine for a few files, but when I upload too many large files, the hidden variables are no longer posted to PHP (!)
I am not sure what is causing the from variables to be ignored by PHP (?)
(I've checked with fiddler and the form indeed sends the right data from clientside... i.e., form fields bypass and id are both properly populated on clientside...)

Uploading files within a larger form (two forms on one page), how can I submit both sets of data (file and form) at once? (PHP)

I have a form such that a list of questions with inputs is followed by an invitation to upload files if they have them.
I have avoided nesting forms by popping up the form containing the upload. The difficulty is that if they press submit on the Uploader form, it will process the upload on the destination page, and likewise if they hit submit on the rest of the form, the uploads are not submitted.
How can I do both at once?
My code:
<form id="questions" action="page2.php" method="POST">
Question 1 <input name="q1"/>
Question 2 <input name="q2" />
Have any files to add? <button id="upload-button">Upload</button>
<input type="submit" value="Submit Answers" />
</form>
<div class="hidden">
<form id="fileupload" enctype="multipart/form-data" action="uploader.php" method="POST">
<input id="fileupload" type="file" name="files[]" multiple>
<input type="submit" value="Upload Files" />
</form>
</div>
jQuery will pop up the hidden div if someone presses the button to add files.
I don't have a problem with them being posted to the same place, but I tried using javascript to use the click event for each button to submit both forms and it did not work.
(Reading stack overflow later explained that only the last submission gets processed in this way)
Any ideas? Thanks
Very simply, structure your HTML like this, and process the logic from both page2.php and uploader.php in one shot (i.e. include the file-upload logic in page2.php). If you show us the contents of both of those files, I can show you how to combine them.
Also added labels with links to the associated inputs, and swapped the submit input for a button element.
<form id="questions" enctype="multipart/form-data" action="page2.php" method="POST">
<label for="q1">Question 1</label>
<input id="q1" name="q1" type="text" />
<label for="q2">Question 2</label>
<input id="q2" name="q2" type="text" />
<label for="fileupload">Upload a File<label>
<input id="fileupload" type="file" name="files[]" multiple />
<button type="submit">Submit</button>
</div>

Categories