Click here to Skip to main content
15,906,335 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: ajax delay Pin
Jeremy Likness9-Jul-09 7:33
professionalJeremy Likness9-Jul-09 7:33 
QuestionISAPI Extension nooB - .dll functions correctly if accessed directly but not through form POST ? Pin
Mike the Red6-Jul-09 1:06
Mike the Red6-Jul-09 1:06 
QuestionFont error .....! Pin
RongNK6-Jul-09 0:50
RongNK6-Jul-09 0:50 
AnswerRe: Font error .....! Pin
Vasudevan Deepak Kumar6-Jul-09 5:40
Vasudevan Deepak Kumar6-Jul-09 5:40 
Questionhow can i stream videos on my server Pin
ahmedhassan965-Jul-09 23:20
ahmedhassan965-Jul-09 23:20 
AnswerRe: how can i stream videos on my server Pin
Sabari MD13-Jul-09 18:22
Sabari MD13-Jul-09 18:22 
AnswerRe: how can i stream videos on my server Pin
dbkman1017-Jul-09 15:47
dbkman1017-Jul-09 15:47 
Questionproblem while uploading multiple files. Pin
techie815-Jul-09 2:16
techie815-Jul-09 2:16 
Hi,

I have this code in JSP for Uploading multiple files :

This is the server side code snippet

<jsp:useBean id="upBean" scope="page" class="javazoom.upload.UploadBean" >
  <jsp:setProperty name="upBean" property="folderstore" value="F:/Program Files/CA/Unicenter Service Delivery/view/webapps/upload/Attach_doc"/>
</jsp:useBean>
<!-- <jsp:useBean id="bean" scope="page" class="javazoom.upload.attach" ></jsp:useBean> -->
<head>
<title>Samples : Simple Upload</title>
<style TYPE="text/css">
<!--
.style1 {
	font-size: 12px;
	font-family: Verdana;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body onload="parent.resizeTo('300','500'); moveTo(0,0);" background = 'background.JPG'>
<ul class="style1">

<%
String i1=request.getParameter("req");
out.println(i1);
int i2=Integer.parseInt(request.getParameter("role"));
%>
<%
		
      if (MultipartFormDataRequest.isMultipartFormData(request))
      {		
         // Uses MultipartFormDataRequest to parse the HTTP request.
         MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
         String todo = null;
		 String userid="";
         if (mrequest != null) { todo = mrequest.getParameter("todo"); userid = mrequest.getParameter("Userid");}
	     if ( (todo != null) && (todo.equalsIgnoreCase("upload")) )
	     {	try{
			 	
			 String filename="";
                Hashtable files = mrequest.getFiles();
                if ( (files != null) && (!files.isEmpty()) )
                {
                    UploadFile file = (UploadFile) files.get("uploadfile");
					file.setFileName(file.getFileName());
					filename=file.getFileName();
                    if (file != null) out.println("<li>Form field : uploadfile"+"<BR> Uploaded file : "+file.getFileName()+" ("+file.getFileSize()+" bytes)"+"<BR> Content Type : "+file.getContentType());
                    // Uses the bean now to store specified by jsp:setProperty at the top.
                    upBean.store(mrequest, "uploadfile");
					//out.println(bean.insert());
                }
                else
                {
                  out.println("<li>No uploaded files");
                }




This is the client side code snippet

<input type="hidden" name="todo" value="upload">
            </td>
		<td>
		<input type="file" name="uploadfile" id="uploadfile" onchange="document.getElementById('moreUploadsLink').style.display = 'block';" />
<div id="moreUploads"></div>
<div id="moreUploadsLink" style="display:none;"><a href="javascript:addFileInput();">Attach another File</a></div>

<script>
var upload_number = 2;
var test="null";
function addFileInput() {
 	var d = document.createElement("div");
 	var file = document.createElement("input");
 	file.setAttribute("type", "file");
 	file.setAttribute("name", "uploadfile"+upload_number);
 	d.appendChild(file);
 	document.getElementById("moreUploads").appendChild(d);
 	upload_number++;
var test = upload_number;

}
</script>





Now when ever I am clicking on the upload button only the first file is getting uploaded. Please tell me what modification I need to do in the code to upload all the files attached.


Thanks in advance
QuestionUnable to view generated thumbnail images. Pin
JimBob SquarePants4-Jul-09 3:51
JimBob SquarePants4-Jul-09 3:51 
AnswerRe: Cracking up! Pin
Not Active4-Jul-09 4:03
mentorNot Active4-Jul-09 4:03 
GeneralRe: Cracking up! Pin
JimBob SquarePants4-Jul-09 6:01
JimBob SquarePants4-Jul-09 6:01 
AnswerRe: Cracking up! Pin
molesworth4-Jul-09 4:59
molesworth4-Jul-09 4:59 
GeneralRe: Cracking up! Pin
JimBob SquarePants4-Jul-09 7:23
JimBob SquarePants4-Jul-09 7:23 
QuestionGame Developing Pin
ShahGopal3-Jul-09 19:14
ShahGopal3-Jul-09 19:14 
AnswerRe: Game Developing Pin
K03063-Jul-09 19:39
K03063-Jul-09 19:39 
Questionupload a website Pin
sheemap3-Jul-09 7:45
sheemap3-Jul-09 7:45 
AnswerRe: upload a website Pin
molesworth3-Jul-09 13:08
molesworth3-Jul-09 13:08 
GeneralRe: upload a website Pin
sheemap4-Jul-09 3:28
sheemap4-Jul-09 3:28 
QuestionJavaScript mounth Calendar Pin
shareef2220002-Jul-09 22:14
shareef2220002-Jul-09 22:14 
AnswerRe: JavaScript mounth Calendar Pin
Marc Firth2-Jul-09 22:27
Marc Firth2-Jul-09 22:27 
GeneralRe: JavaScript mounth Calendar Pin
shareef2220002-Jul-09 22:39
shareef2220002-Jul-09 22:39 
GeneralRe: JavaScript mounth Calendar Pin
Marc Firth2-Jul-09 22:44
Marc Firth2-Jul-09 22:44 
GeneralRe: JavaScript mounth Calendar Pin
shareef2220002-Jul-09 22:48
shareef2220002-Jul-09 22:48 
GeneralRe: JavaScript mounth Calendar Pin
Marc Firth3-Jul-09 0:11
Marc Firth3-Jul-09 0:11 
GeneralRe: JavaScript mounth Calendar Pin
Marc Firth3-Jul-09 0:16
Marc Firth3-Jul-09 0:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.