473,938 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 8998
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*****@agrico reunited.com>
comp.lang.javas cript FAQ - http://jibbering.com/faq

Jul 23 '05 #2
Grant Wagner <gw*****@agrico reunited.com> wrote in message news:<41******* ********@agrico reunited.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*****@agrico reunited.com> wrote in message news:<41******* ********@agrico reunited.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="multip art/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 LimitRequestBod y directive <url:
http://httpd.apache.org/docs/mod/cor...mitrequestbody /> that controls the maximum size of a
GET/POST/PUT.

--
Grant Wagner <gw*****@agrico reunited.com>
comp.lang.javas cript 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
3984
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 file, and use onchange even to upload this file. thanks for any idea. Atse
5
11069
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 created in the wrong folder on the hard drive. Before I discovered these files, .NET kept trying to create a new project with _1 following the project name. Deleting those files corrected that problem. I deleted the Virtual Directory, rebooted, and...
3
1756
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 to do that? please advise. thanks!!
3
8662
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 is if there are any client-side code to check if the path exists in this case? My understanding is that no client-side solution to this problem. please advise. thanks!!
3
26285
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
10
2276
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 based on some dropdown boxes, one for the year and one for the month. This line saves the file so I am trying to get the month and year from the dropdown boxes and put them in the month and year variables but this does not work,...
3
4176
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 String.Format("~/images/categories/{0}", sFileName); else if(File.Exists(String.Format("~/images/products/{0}", sFileName)) return String.Format("~/images/products/{0}", sFileName); else return "";
4
6239
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 Struts: import java.io.File; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Enumeration; import java.util.Iterator;
1
1209
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 is the code I have don so far. Private Function LoadFile(sFile As String) As Boolean Dim filenum Text2.Tag = sFile ' Make sure a file is specified.
0
9963
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
11281
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9852
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7377
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6072
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6283
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4900
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4441
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3495
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.