0
Yahoo의 전자 메일 첨부 단계와 비슷한 html 형식의 여러 업로드 파일을 에뮬레이션하려고합니다. 내 HTML 양식으로이 코드가 있습니다. (outdata는 NSMutableString입니다.)여러 파일이 html 형식으로 업로드됩니다.
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];
결과는 다음과 같습니다. 기본적으로 서버는 파일을 서버 하드 드라이브에 저장합니다. 괜찮 았어. 그것은 두 상자를 채웠지 만 두 번째 파일이 아니라 첫 번째 찾아보기 ... 버튼에만 저장되었습니다. 목표는 제출 버튼을 클릭 할 때 두 상자에있는 파일을 차례로 게시해야한다는 것입니다.
이 클라이언트 측 자바 스크립트를 작성해야합니까? 어떤 도움을 주시면 감사하겠습니다.
iOS와 어떤 관계가 있습니까? iOS에서는 이와 같은 형식으로 파일을 업로드 할 수 없습니다. –
Deusty Designs의 iPhoneHTTPServer를 사용했습니다. – user523234