Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2005

Tip: Looking for answers? Try searching our database.

Uploading a file to the server

Thread view: 
juhunu@gmail.com - 24 Oct 2005 09:30 GMT
This may be a repettive question. But I have searched the web a lot
before posting this here.

I could not find an easy way of doing this.

Here is my requirement.
I want to upload a gif,jpeg file from my system to the TOMCAT server,
In addition I would like to

1. Specify my desired name for the uploaded files into the server.
2. Specify the directory into which I want these files to be uploaded

Filering for gif,jpeg is also fine, if it is easy, but this is not a
must.
Roedy Green - 24 Oct 2005 09:37 GMT
>Here is my requirement.
>I want to upload a gif,jpeg file from my system to the TOMCAT server,
>In addition I would like to
>
>1. Specify my desired name for the uploaded files into the server.
>2. Specify the directory into which I want these files to be uploaded

You do that with an FTP upload utility.  Some of them have scripting.
I have not yet run across any I would find acceptable for fully
unattended use. On my to do list is writing one, probably use the
Apache library or Peter van der Linden's work.

See http://mindprod.com/jgloss/ftp.html

See http://mindprod.com/projects/smartftp.html
for what I consider a suitable tool for the task.

If by any miracle you have  a budget for that task, I would love to
write it for a fee.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.

Andrew Thompson - 24 Oct 2005 09:50 GMT
> I could not find an easy way of doing this.

Define 'easy'.

> Here is my requirement.
> I want to upload a gif,jpeg file from my system to the TOMCAT server,
> In addition I would like to
>
> 1. Specify my desired name for the uploaded files into the server.
> 2. Specify the directory into which I want these files to be uploaded

Servlets that can list and link to files (and directories),
create directories and upload files should do the trick.

Allowing user uploads is a security head-ache, though.

You will probably wake up one morning to find that
your site was removed by the server admin. after serving
a gigabyte of child pornography that came from users
you have never heard of.  Server admin. may inform you
that the local legal authorities are interested in having
a long chat, as well.
PeanutPete - 24 Oct 2005 10:20 GMT
> > I could not find an easy way of doing this.
>
[quoted text clipped - 18 lines]
> that the local legal authorities are interested in having
> a long chat, as well.
PeanutPete - 24 Oct 2005 10:22 GMT
> > I could not find an easy way of doing this.
>
[quoted text clipped - 18 lines]
> that the local legal authorities are interested in having
> a long chat, as well.

You should have a look at the commons file upload project. It only
takes a few lines of code to let you upload a file.
http://jakarta.apache.org/commons/fileupload/
juhunu@gmail.com - 24 Oct 2005 13:07 GMT
Thanks a lot for your replies...
http://jakarta.apache.org/commons/fileupload/  helped
and I have started using it...

Btw. easy means....using Commons fileUpload


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.