Hi,
 
I already changed it but it still does not work.
When the actionRequest is used by portletfileupload it does not go further, but 
also give no error.
PortletFileUpload.isMultipartContent(request);

Does someone have it working? And if so, how?
 
Regards Erik

________________________________

Van: Melchior, Joris [mailto:[EMAIL PROTECTED]
Verzonden: do 22-3-2007 15:24
Aan: Jetspeed Users List
Onderwerp: RE: jetspeed with file upload - multipart



One of us needs reading glasses I think ...

To me it looks like the form you gave as an example uses
'ENCRYPT="multipart/form-data"'. The responder gives a sample that says
"enctype='multipart/form-data'". That's different as far as I can tell.

Cheers, Joris.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, March 22, 2007 4:28 AM
To: [email protected]
Cc: [EMAIL PROTECTED]
Subject: FW: jetspeed with file upload - multipart

Thank you,

But as you can see I am already using the enctype. Other ideas?


________________________________

Van: J.Enrique Ruiz-Valenciano [mailto:[EMAIL PROTECTED]
Verzonden: wo 21-3-2007 21:22
Aan: Jetspeed Users List
Onderwerp: Re: jetspeed with file upload - multipart



I think your error is in the ENCRYPT attribute, this attribute doesn't
exist in the FORM element
(http://www.w3.org/TR/html401/interact/forms.html). You must use the
attribute ENCTYPE. For example:

<form method='post' name='fileForm' action='<portlet:actionURL />'
enctype='multipart/form-data'>

> I am trying to upload a jpg form a form.
> But when I run it it does not give an error, but I know it does not go
further then when I do something with the request. (check if it is
multipart, and when I delete this it holds at putting it in items)
> I am busy with this for more than 2 day so please help
> <form method="POST" ENCRYPT="multipart/form-data"
action="<portlet:actionURL />" >
>  <input type="file" name="photo">
>  <input type="SUBMIT" name="button" value="upload">
> </form>
>
> import org.apache.commons.fileupload.portlet.PortletFileUpload;
> import org.apache.commons.fileupload.*;
>
> import javax.portlet.*;
>
> public void processAction(ActionRequest request, ActionResponse
response) throws PortletException, IOException {
>  boolean isMultiPart = PortletFileUpload.isMultipartContent(request);
>  if (isMultiPart){
>   DiskFileUpload diskUpload = new DiskFileUpload();
>
>      List items = null;
>      items = upload.parseRequest(request);
>
>      Iterator itr = items.iterator();
>      while (itr.hasNext()) {
>       FileItem item = (FileItem) itr.next();
>       if (item.isFormField()) {
>       } else {
>        String itemName = item.getName();
>        File savedFile = new
File(request.getPortletSession().getPortletContext().getRealPath("/")+"u
ploadedFiles/"+itemName);
>        item.write(savedFile);
>       }
>      }   
>  }
> }
>
>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to