Re: File downloading through the java.io.File
Re: File downloading through the java.io.File
- Subject: Re: File downloading through the java.io.File
- From: Jaime Magiera <email@hidden>
- Date: Fri, 25 Feb 2005 08:44:22 -0500
Date: Fri, 25 Feb 2005 11:42:36 +0100
From: Florijan Stamenkovic <email@hidden>
Subject: File downloading through the java.io.File
To: WebObjects Development <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed
Hi guys...
Is there a way I can load a file into Java's File class, and then
sending it to the user as a FTP download. My idea is to have a file
tree organized outside the web server, then take in files through
dynamically resolved paths (say author name is the name of the folder
and book name is the name of the file) into an instance of the File
class, and then send them over to a user, somehow. I tried
experimenting with this, but failed. I suppose the fact that I am not
really a web developer (not much knowledge of html or protocols etc) is
not very helpful.
Can this even be done?
If you want to upload a file onto the server, use WOFileUpload.
If you want to manipulate files on the machine, use the regular java.io classes. It works fine.
Yes, dynamic paths are workable also. I use it on my server in several ways. In one way, users upload music/video files to the site via WOFileUpload. The files are placed in a path based on the "SharedFileDirectoryPath" variable in my "User" Enterprise Object. Then, any work that needs to be done on the file uses the java.io classes (dynamically constructing the path as above). In this particular case, the files aren't made available via ftp, but HTTP download. However, if you just write the file to a FTP accessible path, you should be fine.
I got really excited as a novice programmer when I realized that WO can be mixed with regular file operations. It really opens up a lot of possibilities.
Jaime Magiera
Department of Geological Sciences
University of Michigan
5569 CC Little Building
Ann Arbor, MI 48109
(734) 763-1571
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden