G
Guan
Hi All,
I am trying to use NetComponents-1.3.8a to create a web based FTP
upload and download.
i am using enctype:multipart/form-data for form submission.
To obtained the contain the following code is used,
ServletInputStream inputLocal = request.getInputStream();
inputLocalBuf = new DataInputStream(inputLocal);
if (!ftp.storeFile("test.txt",inputLocalBuf))
- - - - - - - - - -- - - -- - - -- - - - -- - - -- - - - - -- - - -
-- - - - - -
For additional inform,
storefile method - storeFile(String, InputStream) where string will be
the filename, inputstream will be data obtain from inputstream.
This following is the output i obtained when i open the test.txt i
uploaded.
-----------------------------7d6762690786
Content-Disposition: form-data; name="radio1"
upload
-----------------------------7d6762690786
Content-Disposition: form-data; name="datafile"; filename="C:\Documents
and Settings\Administrator\Desktop\test.txt"
Content-Type: text/plain
This is a test
-----------------------------7d6762690786
Content-Disposition: form-data; name="Submit"
Submit
-----------------------------7d6762690786--
- -- - - - - -- - - -- - - - -- - - -- - - -- - - - - - - - - - -- - -
- - -- - - - - -- - - - - - - -- - - - - - - - -
Now my question are:
1) I only need the content - "this is a test" in my test.txt
2) i like to find out how obtain the filename i want from the
multipart/form-data rather than i hardcode.
Thanks in advance
I am trying to use NetComponents-1.3.8a to create a web based FTP
upload and download.
i am using enctype:multipart/form-data for form submission.
To obtained the contain the following code is used,
ServletInputStream inputLocal = request.getInputStream();
inputLocalBuf = new DataInputStream(inputLocal);
if (!ftp.storeFile("test.txt",inputLocalBuf))
- - - - - - - - - -- - - -- - - -- - - - -- - - -- - - - - -- - - -
-- - - - - -
For additional inform,
storefile method - storeFile(String, InputStream) where string will be
the filename, inputstream will be data obtain from inputstream.
This following is the output i obtained when i open the test.txt i
uploaded.
-----------------------------7d6762690786
Content-Disposition: form-data; name="radio1"
upload
-----------------------------7d6762690786
Content-Disposition: form-data; name="datafile"; filename="C:\Documents
and Settings\Administrator\Desktop\test.txt"
Content-Type: text/plain
This is a test
-----------------------------7d6762690786
Content-Disposition: form-data; name="Submit"
Submit
-----------------------------7d6762690786--
- -- - - - - -- - - -- - - - -- - - -- - - -- - - - - - - - - - -- - -
- - -- - - - - -- - - - - - - -- - - - - - - - -
Now my question are:
1) I only need the content - "this is a test" in my test.txt
2) i like to find out how obtain the filename i want from the
multipart/form-data rather than i hardcode.
Thanks in advance