Solved

Check File Exist

Posted on 2000-04-11
2
165 Views
Last Modified: 2013-12-24
Hi,

  I would like to know  how i can check the existence of a file in a local machine.

  my case, i have an input box (file)
which let user upload a file, but i am afraid user will just any how type a filename and then upload it. This will cause an error page. So I would like to check the existence of the file before I do the uploading.
0
Comment
Question by:seahpc
2 Comments
 
LVL 1

Accepted Solution

by:
ruifranco earned 100 total points
ID: 2707716
You can't. That would cause major security problems, so all you can do is check files in the server.

You can, however, filter the file type the user tries to send (ACCEPT field)and you can also check if something has been uploades to the server and what has been uploaded.
0
 

Expert Comment

by:Xavi053000
ID: 2863523
For the existence of a file use the Fileexists(file) function. And too the path of the file with expandpath(file).

i.e: <cfset file = "/images/" & #prod.nr# & ".gif">
<cfif Fileexists(expandpath(file))>
.....
</cfif>
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now