Matt wrote:
Grant Wagner <gw*****@agricoreunited.com> wrote in message news:<41***************@agricoreunited.com>... Matt wrote:
The user can select a file in the file open dialog using <input type="FILE">,
but the user can also enter the full file path in the browse text box manually.
My question is if there are JavaScript to check if the file path exists?
There is no way to test what you want to test when the browser is running the
default security environment.
so you meant client-side validation cannot check in this case? so what
can I do about that? I need to do in server-side validation??
Your server needs to be capable of accepting a <form ... enctype="multipart/form-data"> of arbitrary size.
The code on the server which receives and saves the file can verify it's size and ensure it's name conforms
to the requirements of the file system it is being saved to (by removing or replacing unacceptable
characters).
Typically the server will have some limit on the amount of data it can accept via POST. The server itself
will typically deal with requests to POST data than is allowed with an error of it's own. For example, in
apache I think it's the LimitRequestBody directive <url:
http://httpd.apache.org/docs/mod/cor...mitrequestbody /> that controls the maximum size of a
GET/POST/PUT.
--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ -
http://jibbering.com/faq