ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 15th, 2004, 09:55 AM
saintaw's Avatar
saintaw saintaw is offline
Lurker - in your bushes
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Location: .be
Posts: 479 saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 5 Days 12 h 39 m 8 sec
Reputation Power: 73
Uploading non existing file check?

Greets,

I'm looking for a way to check if a user is trying to upload a non existing file in a form. (IE: if the user types in the path misstakenly instead of using the browse button.)

I've tried the following unsuccessfully:
Code:
   ...
   <cfif CFFILE.fileSize lt 1>
   	//DISPLAY ERROR MESSAGE HERE			
   </cfif>
   ...
   


I need of course to be able to differentiate if the user left the field alone, or if he typed in something...

Cheers.
__________________
Saintaw

pending.

Reply With Quote
  #2  
Old December 15th, 2004, 10:34 AM
bocmaxima's Avatar
bocmaxima bocmaxima is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2004
Location: Tucson, Sonora
Posts: 1,322 bocmaxima User rank is Sergeant (500 - 2000 Reputation Level)bocmaxima User rank is Sergeant (500 - 2000 Reputation Level)bocmaxima User rank is Sergeant (500 - 2000 Reputation Level)bocmaxima User rank is Sergeant (500 - 2000 Reputation Level)bocmaxima User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 17 h 46 m 5 sec
Reputation Power: 23
Send a message via AIM to bocmaxima
CFFILE.FileSize will work on the server side for verifying if the file exists or not.
Quote:
Originally Posted by saintaw
I need of course to be able to differentiate if the user left the field alone, or if he typed in something...

Use JavaScript.

Reply With Quote
  #3  
Old December 15th, 2004, 11:42 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,700 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 17 h 45 m 21 sec
Reputation Power: 53
And due to security issues I'm pretty sure that you can't look into the file system from Javascript. In other words, I am not sure that you can do this unless you go to a Java applet or ActiveX control.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #4  
Old December 17th, 2004, 03:57 AM
saintaw's Avatar
saintaw saintaw is offline
Lurker - in your bushes
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Location: .be
Posts: 479 saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 5 Days 12 h 39 m 8 sec
Reputation Power: 73
Ew.. thanks lads

Reply With Quote
  #5  
Old December 17th, 2004, 09:42 AM
VelvettFogg VelvettFogg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 34 VelvettFogg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 13 m 46 sec
Reputation Power: 4
how about this

<input type="text" name="filename" readonly>

I think it's read only .. this will force them to use the browse button.. so you can guarantee the file did exist.

disabled might work if readonly is the wrong argument.

Reply With Quote
  #6  
Old December 17th, 2004, 09:55 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,700 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 17 h 45 m 21 sec
Reputation Power: 53
Readonly is not universally supported by all browser though. This might work in most cases, but it wouldn't be 100%.

Reply With Quote
  #7  
Old February 21st, 2005, 02:44 AM
saintaw's Avatar
saintaw saintaw is offline
Lurker - in your bushes
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Location: .be
Posts: 479 saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level)saintaw User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 5 Days 12 h 39 m 8 sec
Reputation Power: 73
Very cool, My users are forced to use IE (company policy).

Thanks again!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Uploading non existing file check?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT