You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Justin Jaynes <ju...@yahoo.com> on 2004/09/22 01:36:31 UTC

Allowing users of web app to upload files

Well,

As Yaov said this list was ok for JSP development,
here I go.

I am having a great time using Tomcat on SuSE 9.1 with
SSL and all is working fine.

I would like users of my web applications to be able
to upload image files to directories that Tomcat is
serving files out of.  This must happen THROUGH the
web application.

Therefore I have two questions:

1.  How would I get a file off a remote users hard
drive (which they specify by typing the file name and
location into a text box in a form) to move to my
server and be renamed (using my own file naming
convention)?

2.  How do you open a Browse File dialog box in a web
browser (I would guess this would be easily done using
Java Script.  may not be an appropriate question here,
so only answer if you happen to have the answer on
hand)  If possible, pointing me to a location on the
web where this is done and the script is readily
apparent, would be a fine answer.




		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Allowing users of web app to upload files

Posted by Peter Johnson <pe...@wizardslair.net>.
Justin,

Client Side:
<form method="post" action="" enctype="multipart/form-data">
 <input type="file" name="newfile" value=""/>
 <input type="submit" name="submit" value="Upload File"/>
</form>

This will present a broswe button and text box for the user to select
the file.

Server Side:
Look at FileUpload http://jakarta.apache.org/commons/fileupload/. If
using Struts (http://struts.apache.org/) then you already have access to
FileUpload so look at the JavaDocs for it to find how to use it.

Hope this has helped.

PJ

On Wed, 2004-09-22 at 09:36, Justin Jaynes wrote:
> Well,
> 
> As Yaov said this list was ok for JSP development,
> here I go.
> 
> I am having a great time using Tomcat on SuSE 9.1 with
> SSL and all is working fine.
> 
> I would like users of my web applications to be able
> to upload image files to directories that Tomcat is
> serving files out of.  This must happen THROUGH the
> web application.
> 
> Therefore I have two questions:
> 
> 1.  How would I get a file off a remote users hard
> drive (which they specify by typing the file name and
> location into a text box in a form) to move to my
> server and be renamed (using my own file naming
> convention)?
> 
> 2.  How do you open a Browse File dialog box in a web
> browser (I would guess this would be easily done using
> Java Script.  may not be an appropriate question here,
> so only answer if you happen to have the answer on
> hand)  If possible, pointing me to a location on the
> web where this is done and the script is readily
> apparent, would be a fine answer.
> 
> 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - Send 10MB messages!
> http://promotions.yahoo.com/new_mail
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Allowing users of web app to upload files

Posted by "Kevin D. Offet" <ke...@kaligin.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Justin Jaynes wrote:
| Well,
|
| As Yaov said this list was ok for JSP development,
| here I go.
|
| I am having a great time using Tomcat on SuSE 9.1 with
| SSL and all is working fine.
|
| I would like users of my web applications to be able
| to upload image files to directories that Tomcat is
| serving files out of.  This must happen THROUGH the
| web application.
|
| Therefore I have two questions:
|
| 1.  How would I get a file off a remote users hard
| drive (which they specify by typing the file name and
| location into a text box in a form) to move to my
| server and be renamed (using my own file naming
| convention)?
|
| 2.  How do you open a Browse File dialog box in a web
| browser (I would guess this would be easily done using
| Java Script.  may not be an appropriate question here,
| so only answer if you happen to have the answer on
| hand)  If possible, pointing me to a location on the
| web where this is done and the script is readily
| apparent, would be a fine answer.
|
|

what you are asking is not jsp specific.
all you need is the html element

<INPUT TYPE="file" ...>

set within a html form.

then you need to process the form accordingly when it is submitted.

you might want to check out jakarta commons's FileUpload utilities to
help with the processing.


Kevin


|
|
| 		
| __________________________________
| Do you Yahoo!?
| New and Improved Yahoo! Mail - Send 10MB messages!
| http://promotions.yahoo.com/new_mail
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
| For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBUMvrJ7Xd6MyEGu4RAkH4AKDWmr1ynQ3i0DR+/HiPbT2ifQNwUACfaJKP
9rmInme5NXvJuYolQ4rXIqo=
=JY3a
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Allowing users of web app to upload files

Posted by Justin Jaynes <ju...@yahoo.com>.
No, in fact I didn't see it.  Thank you.  If I have
any specific questions after reading it, I will ask.

Thank you so much.

Justin Jaynes

--- QM <qm...@brandxdev.net> wrote:

> On Thu, Sep 23, 2004 at 12:14:18PM -0700, Justin
> Jaynes wrote:
> : So my question:  How do I USE the fileupload
> Commons
> : package?  I don't see any instructions with the
> : COMMONS packages.
> 
> I take it, then, you didn't see this?
>
http://jakarta.apache.org/commons/fileupload/using.html
> 
> If you did read it, then what are your specific
> questions?
> 
> -QM
> 
> -- 
> 
> software  -- http://www.brandxdev.net
> tech news -- http://www.RoarNetworX.com
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Allowing users of web app to upload files

Posted by QM <qm...@brandxdev.net>.
On Thu, Sep 23, 2004 at 12:14:18PM -0700, Justin Jaynes wrote:
: So my question:  How do I USE the fileupload Commons
: package?  I don't see any instructions with the
: COMMONS packages.

I take it, then, you didn't see this?
http://jakarta.apache.org/commons/fileupload/using.html

If you did read it, then what are your specific questions?

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Allowing users of web app to upload files

Posted by Justin Jaynes <ju...@yahoo.com>.
I just realized I misspelled Yoav's name in my earlier
question.  My appologies Yoav.

So my question:  How do I USE the fileupload Commons
package?  I don't see any instructions with the
COMMONS packages.

Thanks for the quick directions in response to my
problem.  However, I am not familiar with the COMMONS
project.  I admit that I have a difficult time
understanding how to implement other peoples
programming in a way that it works with mine.  I know
how to use my own, because I wrote it.  So I am at the
stage in my programming 'carreer' that I need to learn
how to tie in other work with my own.  If someone
could answer my fileupload Commons question directly,
that would be nice.  Pointing me in the proper
direction to LEARN how to use it would be useful as
well.

Justin Jaynes


--- Tim Funk <fu...@joedog.org> wrote:

> See http://jakarta.apache.org/commons/fileupload/
> 
> -Tim
> 
> Justin Jaynes wrote:
> > Well,
> > 
> > As Yaov said this list was ok for JSP development,
> > here I go.
> > 
> > I am having a great time using Tomcat on SuSE 9.1
> with
> > SSL and all is working fine.
> > 
> > I would like users of my web applications to be
> able
> > to upload image files to directories that Tomcat
> is
> > serving files out of.  This must happen THROUGH
> the
> > web application.
> > 
> > Therefore I have two questions:
> > 
> > 1.  How would I get a file off a remote users hard
> > drive (which they specify by typing the file name
> and
> > location into a text box in a form) to move to my
> > server and be renamed (using my own file naming
> > convention)?
> > 
> > 2.  How do you open a Browse File dialog box in a
> web
> > browser (I would guess this would be easily done
> using
> > Java Script.  may not be an appropriate question
> here,
> > so only answer if you happen to have the answer on
> > hand)  If possible, pointing me to a location on
> the
> > web where this is done and the script is readily
> > apparent, would be a fine answer.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> 
> 



		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Allowing users of web app to upload files

Posted by Tim Funk <fu...@joedog.org>.
See http://jakarta.apache.org/commons/fileupload/

-Tim

Justin Jaynes wrote:
> Well,
> 
> As Yaov said this list was ok for JSP development,
> here I go.
> 
> I am having a great time using Tomcat on SuSE 9.1 with
> SSL and all is working fine.
> 
> I would like users of my web applications to be able
> to upload image files to directories that Tomcat is
> serving files out of.  This must happen THROUGH the
> web application.
> 
> Therefore I have two questions:
> 
> 1.  How would I get a file off a remote users hard
> drive (which they specify by typing the file name and
> location into a text box in a form) to move to my
> server and be renamed (using my own file naming
> convention)?
> 
> 2.  How do you open a Browse File dialog box in a web
> browser (I would guess this would be easily done using
> Java Script.  may not be an appropriate question here,
> so only answer if you happen to have the answer on
> hand)  If possible, pointing me to a location on the
> web where this is done and the script is readily
> apparent, would be a fine answer.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org