473,320 Members | 1,600 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Check if File Path Exists in Browse Text Box

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?

please advise. thanks!!
Jul 23 '05 #1
3 8967
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.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #2
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??

please advise. thanks!!
Jul 23 '05 #3
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

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: atse | last post by:
Hi, In the file field <input type="file" name="file1">, can I modify the button "Browse..."? I want to hide the file field but show a button like "Open". When I click on this button, it catches a...
5
by: David Webb | last post by:
The problem started when the Working Folder for a project was somehow set to the folder of another project. I set the correct working folder in VSS and deleted the .vbproj files that had been...
3
by: Matt | last post by:
Is there a way to use JavaScript to check if a file path exists? For example, user enter C:\eklrjlejr in a text box, and I want to check if the file really exists. Is there a way to use JavaScript...
3
by: Matt | last post by:
<input type="file" size=50"> will produce the browse button and browse text box. The user can either select the file from browse button, or enter a path in browse text box manually. My question...
3
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
10
by: Paul | last post by:
Hi I am using the HtmlInputFile control to upload a file from a client to a server. I have a browse to find the file on the server but need to create the path dynamically as to were it will go...
3
by: trint | last post by:
How can I do this with my c# code with my website(because the file is there, but the code doesn't return it)?: if(File.Exists(String.Format("~/images/categories/{0}", sFileName)) return...
4
by: AshishMishra16 | last post by:
HI friends, I am using the Flex to upload files to server. I m getting all the details about the file, but I m not able to upload it to Server. Here is the code i m using for both flex & for...
1
by: vanita01 | last post by:
Hi Can anyone please help me. I am trying to browse for a file. I would like the file path name to be shown on a text box. Using the upload button I would then like to save the file on mysql. is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.