Doing a form-based FILE-UPLOAD from inside a servlet

D

DiscoStu

Hello Everyone,

I have two tomcat servers, one running on the client machine and
one running on the server machine. I needed offline support for my
application, thats why I need tomcat on the client machine. Well, I
want to upload my reports to the server and I was thinking the HTML
form based upload would be nice, but I dont want the user to have to
select the file thats going to be uploaded. Is there any way to have
it upload a specific file rather then letting the user select a file?

Thanks (Maybe this question is better suited to an HTML newsgroup, but
java makes me happy)
 
M

mromarkhan

Peace be unto you

Try value

type=file
Creates a file select control.
User agents may use the value of
the value attribute as the initial file name.

http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.4


8. Security Considerations

It is important that a user agent not send any file that the user has
not explicitly asked to be sent. Thus, HTML interpreting agents are
expected to confirm any default file names that might be suggested
with <INPUT TYPE=file VALUE="yyyy">. Never have any hidden fields be
able to specify any file.
http://www.ietf.org/rfc/rfc1867.txt



Note: Never have any hidden fields be able to specify any file.
However, I guess user agents might not deter the usage of the javascript submit() function
or the setting of the css visibility property of the containing element to invisible.


Have a good day.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top