Re: File upload question yet again

2003-06-23 Thread Erik Price


Alen Ribic wrote:

What I whish to avoid is that a file does not get loaded as a property each
time the value object is needed but only when a image viewing is required.
(e.g. a "view image" link is clicked in manager role view)
Store a reference to the file (perhaps a String pathname) rather than 
the File itself as a property.

Erik

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


File upload question yet again

2003-06-22 Thread Alen Ribic
Hi everyone

I know that this question might have been asked in the past, but the mailing
list archive returns no results for me with keywords "file upload".
I just wanna know the best, preferred, way of uploading a file in Struts.

My scenario

I have simple products for a B2C system that have input fields for product
details.
Now I wish to provide a file input field, allowing manager to upload an
image for a product.

What I whish to avoid is that a file does not get loaded as a property each
time the value object is needed but only when a image viewing is required.
(e.g. a "view image" link is clicked in manager role view)

Any help would very much be appreciated.

--Alen


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



Re: [OT] form wizard with upload question

2003-03-09 Thread Dan Allen

> > Assume I have a 4 page form which gathers user information, address
> > information and company information.  I would like to give the user
> > the opportunity to upload a logo while filling out the form.  If I
> > do this in the natural place, which would be in step 2, I am not
> > sure how to handle the case where the user will cancel the form in
> > step 3 if I save the logo to disk.
> 
> I would try to provide the best ergonomics and therefore I'd have logo 
> upload in the second step. When uploaded, place the image in a temp. folder 
> under the .gif name or something like that. When the wizard 
> completes, place the uploaded image in the right place and remove it from 
> the temp. dir. Also, if you have 'cancel' button in your wizard, bind it to 
> CleanAction or something like that. Also, servlet spec 2.3 defines some 
> session listener classes which could be used to periodically check the temp 
> dir and the active sessions (no active session -- delete the file). And, of 
> course, simple cron job which deletes temp files older than X hours is a 
> must.
Fair enough.  I like the idea of the cancel button, that will
definitely keep things clean.  One thing that sucks about the web is
that users can abandon forms by killing the window and then you are
left stranded.  But crons (whether by deamon or event listeners)
will keep it tidy for now.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <[EMAIL PROTECTED]>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
"I am the GOD.the GOD...of house!" 
 -- Leeloo
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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



Re: [OT] form wizard with upload question

2003-03-09 Thread Davor Cengija
Dan Allen wrote:
 
> Assume I have a 4 page form which gathers user information, address
> information and company information.  I would like to give the user
> the opportunity to upload a logo while filling out the form.  If I
> do this in the natural place, which would be in step 2, I am not
> sure how to handle the case where the user will cancel the form in
> step 3 if I save the logo to disk.

I would try to provide the best ergonomics and therefore I'd have logo 
upload in the second step. When uploaded, place the image in a temp. folder 
under the .gif name or something like that. When the wizard 
completes, place the uploaded image in the right place and remove it from 
the temp. dir. Also, if you have 'cancel' button in your wizard, bind it to 
CleanAction or something like that. Also, servlet spec 2.3 defines some 
session listener classes which could be used to periodically check the temp 
dir and the active sessions (no active session -- delete the file). And, of 
course, simple cron job which deletes temp files older than X hours is a 
must.
-- 
[EMAIL PROTECTED]


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



[OT] form wizard with upload question

2003-03-09 Thread Dan Allen
I set this to off topic since it really isn't limited to struts, but
I was interested in the advice this community could provide.

Assume I have a 4 page form which gathers user information, address
information and company information.  I would like to give the user
the opportunity to upload a logo while filling out the form.  If I
do this in the natural place, which would be in step 2, I am not
sure how to handle the case where the user will cancel the form in
step 3 if I save the logo to disk.

I am keeping the form data in a session until the wizard is
completed.  If I write the uploaded file to disk after step 2 (I
wouldn't want to keep it in the session, not even sure I can) then I
will junk up my upload directory for users who cancel the form.

One natural place to put the upload would be after the wizard is
complete and the data solidified.  Then, the upload could be
attached to the saved data.

Any thoughts/advice on how to handle this form?  The following is
the wizard

user info (login, email) ->
company info (independent business) ->
address info (for the company) ->
category info (categorize the business)

It would make sense to put the upload with the company info, but the
user is not saved to disk (in the database) until the whole form is
completed.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <[EMAIL PROTECTED]>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Microsoft is not the answer, it is the question. 
The answer is NO!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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



Re: upload question

2002-08-20 Thread Alex Birch

I'm not sure if I understand you right, but is it because the upload example simply 
displays the
contents of the files you upload directly to the browser (using out.print)? Because 
the image is a
binary file it won't display nor would any other binary file...

I haven't had any troubles uploading binary files before using struts

hope that helps...

Alex



 --- jfc <[EMAIL PROTECTED]> wrote: 
> Hi,
> 
> Just a quick question.
> 
> Why do I get garbage when I upload a jpeg or gif image file when using 
> the upload example in struts? I can see the image if I navigate to it in 
> my local fs using my browser but not by using the example upload war app.
> 
> Cheers
> jfc
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
>  

__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




upload question

2002-08-20 Thread jfc

Hi,

Just a quick question.

Why do I get garbage when I upload a jpeg or gif image file when using 
the upload example in struts? I can see the image if I navigate to it in 
my local fs using my browser but not by using the example upload war app.

Cheers
jfc


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Quick Upload Question

2002-08-14 Thread Jacob Hookom

I apologize for the following post, I forget the whole abstract/extend
thing that java does ;-)


| -Original Message-
| From: Jacob Hookom [mailto:[EMAIL PROTECTED]]
| Sent: Wednesday, August 14, 2002 4:09 PM
| To: 'Struts Users Mailing List'
| Subject: Quick Upload Question
| 
| I checked the mail-archive for a solution, but I was wondering if I
have
| an Action receive an upload request, do some processing, then forward
it
| off to another action to actually handle the file writing, is there
| going to be an issue?
| 
| ProjectResourceUpload.do
|   //do processing
|   return ActionForward("defaultUpload", true);
| 
| Will defaultUpload get the same form that was passed to me?
| 
| I remember someone mentioning back in early July that they thought the
| whole request was 're-evaluated' or something which caused major slow
| downs if the action was forwarded.
| 
| Any help is much apprechiated!
| 
| Regards,
| Jacob Hookom
| Comprehensive Computer Science
| University of Wisconsin, Eau Claire
| 
| 
| 
| ---
| Outgoing mail is certified Virus Free.
| Checked by AVG anti-virus system (http://www.grisoft.com).
| Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/2002
| 
| 
| 
| --
| To unsubscribe, e-mail:   <mailto:struts-user-
| [EMAIL PROTECTED]>
| For additional commands, e-mail: <mailto:struts-user-
| [EMAIL PROTECTED]>
| 
| ---
| Incoming mail is certified Virus Free.
| Checked by AVG anti-virus system (http://www.grisoft.com).
| Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/2002
| 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/2002
 


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




Quick Upload Question

2002-08-14 Thread Jacob Hookom

I checked the mail-archive for a solution, but I was wondering if I have
an Action receive an upload request, do some processing, then forward it
off to another action to actually handle the file writing, is there
going to be an issue?

ProjectResourceUpload.do
//do processing
return ActionForward("defaultUpload", true);

Will defaultUpload get the same form that was passed to me?

I remember someone mentioning back in early July that they thought the
whole request was 're-evaluated' or something which caused major slow
downs if the action was forwarded.

Any help is much apprechiated!

Regards,
Jacob Hookom 
Comprehensive Computer Science 
University of Wisconsin, Eau Claire 



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/2002
 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




File upload question

2002-02-19 Thread Ji Li

Hi,

I am using struts' upload package to implement file upload feature. However I have a 
question about the temp dir. say I use java.io.tmpdir as the temp dir for 
MultipartIterator.
What happend if multiple users upload the same file at the same time, will the 
previous 
file be overwrittern by the later ones?

Thanks!

Ji Li


Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Upload question

2001-11-14 Thread Daniel WAMARA

I just have one form and I do handle the file via its Input stream but the 
application doesn't ever let me the time to say "hi" that I've already this 
BeanUtils.populate error.

Daniel WAMARA


>From: Balasubrahmanyam Pasumarthy <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: Re: Upload question
>Date: Wed, 14 Nov 2001 19:42:09 +0530
>
>Hi Daniel,
>
>I got the similar problem with. The problem is eliminated because of two 
>things:
>
>1) Just check whether you have two form elements. Use only one struts form 
>tag
>2) It is a must that you have to handle that file. That is getting its 
>input stream and read it to somewhere.
>
>Hope this helps
>
>Balu
>At 11:56 AM 11/14/01 +0100, you wrote:
>>So could you telle me what can mean a "ServletException 
>>BeanUtils.populate" because it's the error I got as soon as I click on the 
>>upload button and how do I can get a ride on it ?
>>
>>Thanks for help,
>>
>>Daniel WAMARA
>>
>>_
>>Téléchargez MSN Explorer gratuitement à l'adresse 
>>http://explorer.msn.fr/intl.asp
>>
>>
>>--
>>To unsubscribe, e-mail:   
>><mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail: 
>><mailto:[EMAIL PROTECTED]>
>>
>
>Balasubrahmanyam Pasumarthy
>**
>Sr. Consultant,
>Zensar Technologies Ltd,
>Ph: 91-20-6633001 extn 613
>***
>
>
>
>--
>To unsubscribe, e-mail:   
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: 
><mailto:[EMAIL PROTECTED]>
>


_
Téléchargez MSN Explorer gratuitement à l'adresse 
http://explorer.msn.fr/intl.asp


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




Re: Upload question

2001-11-14 Thread Balasubrahmanyam Pasumarthy

Hi Daniel,

I got the similar problem with. The problem is eliminated because of two 
things:

1) Just check whether you have two form elements. Use only one struts form tag
2) It is a must that you have to handle that file. That is getting its 
input stream and read it to somewhere.

Hope this helps

Balu
At 11:56 AM 11/14/01 +0100, you wrote:
>So could you telle me what can mean a "ServletException 
>BeanUtils.populate" because it's the error I got as soon as I click on the 
>upload button and how do I can get a ride on it ?
>
>Thanks for help,
>
>Daniel WAMARA
>
>_
>Téléchargez MSN Explorer gratuitement à l'adresse 
>http://explorer.msn.fr/intl.asp
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>

Balasubrahmanyam Pasumarthy
**
Sr. Consultant,
Zensar Technologies Ltd,
Ph: 91-20-6633001 extn 613
***



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Upload question

2001-11-14 Thread Daniel WAMARA

So could you telle me what can mean a "ServletException BeanUtils.populate" 
because it's the error I got as soon as I click on the upload button and how 
do I can get a ride on it ?

Thanks for help,

Daniel WAMARA

_
Téléchargez MSN Explorer gratuitement à l'adresse 
http://explorer.msn.fr/intl.asp


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Upload question

2001-11-14 Thread stefan werner

Hi,
Yes, it works very satisfying.
Stefan
- Original Message -
From: "Daniel WAMARA" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 14, 2001 9:05 AM
Subject: Upload question


> Does anyone has ever made an upload via Struts and this has worked ?
Because
> I've tried y myself and got always failure, and even my Struts-Uplod
Example
> doesn't work.
>
> Daniel WAMARA
>
> _
> Téléchargez MSN Explorer gratuitement à l'adresse
> http://explorer.msn.fr/intl.asp
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


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




Upload question

2001-11-14 Thread Daniel WAMARA

Does anyone has ever made an upload via Struts and this has worked ? Because 
I've tried y myself and got always failure, and even my Struts-Uplod Example 
doesn't work.

Daniel WAMARA

_
Téléchargez MSN Explorer gratuitement à l'adresse 
http://explorer.msn.fr/intl.asp


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Upload Question

2001-10-27 Thread martin . cooper

The same way that you did in the past. Just use getServlet(), which is in
the Struts Action class that your action extends, to get the servlet object.

--
Martin Cooper


- Original Message -
From: "Brandon Goodin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 26, 2001 11:44 PM
Subject: Upload Question


> In the process of uploading images to the server I need to determine the
> location of my application on the server so that I can write to an
absolute
> location on the drive that I can acess from my webapp. In the past
> (pre-Struts) I used the Servlet Context to determine where the web-app was
> located. How do I get the app location from within a ActionClass?
>
> Brandon Goodin
> Phase Communications
> P (406)862-2245
> F (406)862-0354
> http://www.phase.ws
>



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




Upload Question

2001-10-27 Thread Brandon Goodin

In the process of uploading images to the server I need to determine the
location of my application on the server so that I can write to an absolute
location on the drive that I can acess from my webapp. In the past
(pre-Struts) I used the Servlet Context to determine where the web-app was
located. How do I get the app location from within a ActionClass?

Brandon Goodin
Phase Communications
P (406)862-2245
F (406)862-0354
http://www.phase.ws




RE: File upload question

2001-09-21 Thread Ajay Chitre

Jon,

I don't think you need to use DiskMultipartRequestHandler directly from
your action class.  Have you looked at the example that comes with Struts?
 Look for a file called 'struts-upload.war'.

If this doesn't help let me know.  I have been able to upload files to the
server using Struts.

Hope this helps.

- Ajay


-- Original Message --

>All,
>
>I am trying to upload a file to the server using the input type file and
>setting enctype="multipart/form-data" in the form. I've tried using the
>DiskMultipartRequestHandler in my action class, but keep getting a null
>pointer exception when I call the handleRequest method. Apparently it
>happens when the tempDir is being looked up. To get round this I tried
>putting the following in my web.xml under the  entry for the struts
>action servlet:
>
>
>maxFileSize
>250M
>
>
>multipartClass
>
>org.apache.struts.upload.DiskMultipartRequestHandlerue>
>
>
>tempDir
>/WEB-INF/temp/
>
>
>I've also tried the tempDir as /WEB-INF/temp and C:\
>
>But I still get the null pointer exception:
>
>java.lang.NullPointerException
>at
>org.apache.struts.upload.DiskMultipartRequestHandler.retrieveTempDir(DiskMul
>tipartRequestHandler.java:207)
>at
>org.apache.struts.upload.DiskMultipartRequestHandler.handleRequest(DiskMulti
>partRequestHandler.java:63)
>
>Any help would be greatly appreciated.
>
>Cheers,
>Jon.
>
>
>=**
>
>If you are not the intended recipient, employee or agent responsible for
>delivering the message to the intended recipient, you are hereby notified
>that any dissemination or copying of this communication and its attachments
>is strictly prohibited.
>
>If you have received this communication and its attachments in error, please
>return the original message and attachments to the sender using the reply
>facility on e-mail.
>
>Internet communications are not secure and therefore the UCLES Group does
>not accept legal responsibility for the contents of this message.  Any
views
>or opinions presented are solely those of the author and do not necessarily
>represent those of the UCLES Group unless otherwise specifically stated.
>
>This footnote also confirms that this email message has been swept by
>MIMEsweeper for the presence of computer viruses although this does not
guarantee
>that this email is virus free.
>
>**=
>
>

Ajay Chitre

Diligent Team, Inc.
(Where Diligent People Work as a Team)

http://www.DiligentTeam.com





File upload question

2001-09-21 Thread Jon Dickinson

All,

I am trying to upload a file to the server using the input type file and
setting enctype="multipart/form-data" in the form. I've tried using the
DiskMultipartRequestHandler in my action class, but keep getting a null
pointer exception when I call the handleRequest method. Apparently it
happens when the tempDir is being looked up. To get round this I tried
putting the following in my web.xml under the  entry for the struts
action servlet:


maxFileSize
250M


multipartClass
 
org.apache.struts.upload.DiskMultipartRequestHandler


tempDir
/WEB-INF/temp/


I've also tried the tempDir as /WEB-INF/temp and C:\

But I still get the null pointer exception:

java.lang.NullPointerException
at
org.apache.struts.upload.DiskMultipartRequestHandler.retrieveTempDir(DiskMul
tipartRequestHandler.java:207)
at
org.apache.struts.upload.DiskMultipartRequestHandler.handleRequest(DiskMulti
partRequestHandler.java:63)

Any help would be greatly appreciated.

Cheers,
Jon.


=**

If you are not the intended recipient, employee or agent responsible for delivering 
the message to the intended recipient, you are hereby notified that any dissemination 
or copying of this communication and its attachments is strictly prohibited.

If you have received this communication and its attachments in error, please return 
the original message and attachments to the sender using the reply facility on e-mail.

Internet communications are not secure and therefore the UCLES Group does not accept 
legal responsibility for the contents of this message.  Any views or opinions 
presented are solely those of the author and do not necessarily represent those of the 
UCLES Group unless otherwise specifically stated.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses although this does not guarantee that 
this email is virus free.

**=