0

I am trying to emulate the multiple upload files in html form that looks similar to Yahoo's email attachments steps. I have this code as my html form. (outdata is a NSMutableString.)

 id out = @"<form action=\"\" method=\"post\" enctype=\"multipart/form-data\" name=\"form1\" id=\"form1\">"
 "<label>upload file:"
 "<p>"
 "</label>"
 "<label>"
 "<input type=\"file\" name=\"file1\" id=\"file1\" value=\"LookUp1\" />"
 "</label>"
 //"<label>"
 //"<input type=\"submit\" name=\"button\" id=\"button\" value=\"Submit1\" />"
 //"</label>"]
 //"</form>"

 //add 2nd browse submit
 //"<form action=\"\" method=\"post\" enctype=\"multipart/form-data\" name=\"form1\" id=\"form1\">"
 //"<label>upload file"
 //"</label>"
 "<p>"
 "<label>"
 "<input type=\"file\" name=\"file2\" id=\"file2\" value=\"LookUp2\" />"
 "</label>"
 "<label>"
 "<input type=\"submit\" name=\"button\" id=\"button\" value=\"Submit\" />"
 "</label>"
 "</form>";

[outdata appendString:out];

The result of the html output is below. Basically, the server will save the file on the server hard drive. It worked fine. Except that it only saved the file the first Browse... button not the 2nd one even though I populated both boxes. The goal is that when I clicked on the Submit button, the files in both boxes should be posted one after another.

Is this client side javascript I need to write. Any help would be appreciated.

enter image description here

2
  • What is the tie in with iOS? You cannot upload files via forms like this in iOS. Commented Jul 27, 2011 at 20:58
  • I used iPhoneHTTPServer from Deusty Designs Commented Jul 28, 2011 at 17:23

1 Answer 1

1

There are libraries doing this trick, so maybe they can solve your problem completely or inspire you in some way. For example http://digitarald.de/project/fancyupload/ is capable of this.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.