You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/08/08 15:20:26 UTC
DO NOT REPLY [Bug 36081] New: -
No items in list in uploaded objects
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36081>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=36081
Summary: No items in list in uploaded objects
Product: Commons
Version: unspecified
Platform: PC
OS/Version: Windows 2000
Status: NEW
Severity: blocker
Priority: P2
Component: File Upload
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: charlesavt@yahoo.com
Client Side(Just the contents between the form tags shown)
----------------
<form name="MyPicture" method="post" action="/DynaPict/performSavePicture.do"
enctype="multipart/form-data">
<table width=100% height=100%>
<tr><td align='center' valign='center'>
<table>
<tr>
<td>
<basefont class="javawebapp">User Name:</basefont>
</td>
<td>
<input type="text" name="userId" maxlength="20" value="">
</td>
</tr>
<tr>
<td>
<basefont class="javawebapp">File Uploader:</basefont>
</td>
<td>
<input type="file" name="myfile" value="">
</td>
</tr>
<tr>
<td VALIGN='top'>
<a
onMouseOver = "hiLite('saves1','savesover','on')"
onMouseOut = "hiLite('saves1','saves','off')"
href='javascript:document.forms["MyPicture"].submit();'><IMG
SRC='images/savebutton.jpg' NAME='saves1' ALT='Go ' ALIGN='left' VALIGN='top'>
</a>
</td>
<td align='right' VALIGN='top'>
<a style="color: #3366ff;" onMouseOver = "hiLite
('cancels1','cancelsover','on')" onMouseOut = "hiLite
('cancels1','cancels','off')"
href="login.jsp" class="javawebapp"
><IMG SRC='images/cancelbutton.jpg' NAME='cancels1' ALT='Go '
VALIGN='top'></A>
</td>
</td>
</tr>
</table>
</td></tr>
</table>
</form>
Server side(Just the first part of the struts execute method shown)
----------------
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
ActionForward forward = null;
// Create a new file upload handler
DiskFileUpload upload = new DiskFileUpload();
// Parse the request
List items = upload.parseRequest(request);
//Test 1-This shows the list contains no items
System.out.println("List Size " + items.size());
//Test 2-This shows that the text field from the form is present
System.out.println("UI=" + request.getParameter("userId"));
// Process the uploaded items
Iterator iter = items.iterator();
while (iter.hasNext()) {
..........................
OUTPUT
List Size 0
UI=tester
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org