Solved

Check File Exist

Posted on 2000-04-11
2
198 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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 …
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

734 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