471,603 Members | 1,503 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,603 software developers and data experts.

Query on multipart/form-data.

dmjpro
2,476 2GB
A Question was in my mind for a long day.
But today suddenly knocks my mind again.
So I am asking that Question here...Please Experts answer my Question.

Expand|Select|Wrap|Line Numbers
  1. <form enctype="multipart/form-data" action = "XYZ">
  2. <input type = file name=file1></input>
  3. <input type = file name=file2></input>
  4. <input type = file name = file3></input>
  5. <input type = text name =text1></input>
  6. <input type = text name =text1></input>
  7. <input type = hidden name =hidden1></input>
  8. <input type = hidden name =hidden2></input>
  9. <input type=submit></input>
  10. </form>
  11.  
All of us know the multipart/form-data handled with special care.
I mean in different way.
Look at my HTML code carefully.
See, there are there File Upload fields, two Text Box nd two Hidden fields.
Now my Question is that if I submit this form then only three File Upload datas will go to the Target Action.
But I want to make my Target available rest four Fields.
How can I do that.
Actually in Normal way it is not Possible.
I tested but I failed.
So Experts, please help.

Kind regards,
Dmjpro.
Sep 12 '07 #1
6 2873
A Question was in my mind for a long day.
But today suddenly knocks my mind again.
So I am asking that Question here...Please Experts answer my Question.

Expand|Select|Wrap|Line Numbers
  1. <form enctype="multipart/form-data" action = "XYZ">
  2. <input type = file name=file1></input>
  3. <input type = file name=file2></input>
  4. <input type = file name = file3></input>
  5. <input type = text name =text1></input>
  6. <input type = text name =text1></input>
  7. <input type = hidden name =hidden1></input>
  8. <input type = hidden name =hidden2></input>
  9. <input type=submit></input>
  10. </form>
  11.  
All of us know the multipart/form-data handled with special care.
I mean in different way.
Look at my HTML code carefully.
See, there are there File Upload fields, two Text Box nd two Hidden fields.
Now my Question is that if I submit this form then only three File Upload datas will go to the Target Action.
But I want to make my Target available rest four Fields.
How can I do that.
Actually in Normal way it is not Possible.
I tested but I failed.
So Experts, please help.

Kind regards,
Dmjpro.
I used this (which is a php script so that I can see what is reported server-side) and it worked fine:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. print_r($_FILES);
  3. print_r($_POST);
  4. ?>
  5. <html>
  6.   <head>
  7.   </head>
  8.   <body> 
  9. <form enctype="multipart/form-data" method="post" action="this.php">
  10. <input type = "file" name="file1"></input>
  11. <input type = "file" name="file2"></input>
  12. <input type = "file" name ="file3"></input>
  13. <input type = "text" name ="text1"></input>
  14. <input type = "text" name ="text2"></input>
  15. <input type = "hidden" name ="hidden1"></input>
  16. <input type = "hidden" name ="hidden2"></input>
  17. <input type="submit"></input>
  18. </form>
  19.   </body>
  20. </html>
  21.  

You should note in your post that the name of the text fields didn't vary.

Also, the file should be named whatever you have in the action attribute. I chose "this.php".
Sep 12 '07 #2
dmjpro
2,476 2GB
I used this (which is a php script so that I can see what is reported server-side) and it worked fine:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. print_r($_FILES);
  3. print_r($_POST);
  4. ?>
  5. <html>
  6.   <head>
  7.   </head>
  8.   <body> 
  9. <form enctype="multipart/form-data" method="post" action="this.php">
  10. <input type = "file" name="file1"></input>
  11. <input type = "file" name="file2"></input>
  12. <input type = "file" name ="file3"></input>
  13. <input type = "text" name ="text1"></input>
  14. <input type = "text" name ="text2"></input>
  15. <input type = "hidden" name ="hidden1"></input>
  16. <input type = "hidden" name ="hidden2"></input>
  17. <input type="submit"></input>
  18. </form>
  19.   </body>
  20. </html>
  21.  

You should note in your post that the name of the text fields didn't vary.

Also, the file should be named whatever you have in the action attribute. I chose "this.php".

Your this.php canget the parameter values of four fieds except File Tags?
Please let me know.

Kind regards,
Dmjpro.
Sep 13 '07 #3
I'm not sure what you're talking about. There are no file tags. The input tags which have type="file" are available via the $_FILES array in PHP, if that's what you're talking about.
Sep 13 '07 #4
dmjpro
2,476 2GB
I'm not sure what you're talking about. There are no file tags. The input tags which have type="file" are available via the $_FILES array in PHP, if that's what you're talking about.
Yup!
But if I do enctype=multipart/form-data then only my Action gets the information abut File Tags.
But how can I get the values of rest four fields?
This is my Question.
Please help me.

Kind regards,
Dmjpro.
Sep 13 '07 #5
Again, there's no such thing as file tags. If you run my code, fill in the values, and click the button, you'll see an array of all information submitted including every single field in the form.

Try it.
Sep 13 '07 #6
dmjpro
2,476 2GB
Again, there's no such thing as file tags. If you run my code, fill in the values, and click the button, you'll see an array of all information submitted including every single field in the form.

Try it.
I will try it on my Server Side Scripting.

Kind regards,
Dmjpro.
Sep 13 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Damien | last post: by
4 posts views Thread by Hunter Peress | last post: by
reply views Thread by Travis Pupkin | last post: by
4 posts views Thread by John Fereira | last post: by
2 posts views Thread by Der tolle Emil | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.