ColdFusion

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsWeb Design & DevelopmentColdFusion

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 Tutorialized Forums Sponsor:
  #1  
Old December 29th, 2004, 04:46 AM
marcovdo marcovdo is offline
Contributing User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 1 marcovdo New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via MSN to marcovdo
Simpel problem, butt can't make it work (Coldfusion)

Hi there,

When a user not provide a picture, i want to give the file field a default name like nopicture.jpg, so that we will not see a blank image placeholder butt a neat pic that tells us that no picture was provided.

I allready tried in acces give default values but the filefield seems to overwrite these settings with (if the field by the user is left blank) a blank record, so no picture is shown.

Well, it seems to be a simple problem, butt it's always and you just have to know, that makes it difficult sometimes huh...

Thanks in advance

Best regards,

Marco

Reply With Quote
  #2  
Old December 29th, 2004, 11:42 AM
kurt kurt is offline
Contributing User
Tutorialized Novice (500 - 999 posts)
 
Join Date: Jan 2004
Posts: 506 kurt User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 48 sec
Reputation Power: 0
Well, if the user is submitting a form with an image file in it, I'd use PHP to do this:

Code:
// 'imagefile' is the form attribute name of the uploaded image
if (strlen($_FILES['imagefile']['name']) > 0) {
  // give the filename a unique name using a timestamp
  $filename = "($time_stamp)".$_FILES['imagefile']['name'];
  // copy the file from the tmp directory to your home directory
  copy ($_FILES['imagefile']['tmp_name'], "/full/path/to/dir/".$filename);
} else {
  // if no filename, name it default.jpg
  $filename = "default.jpg";
}

// now we insert the data into the database here
.....  $filename  ......

Reply With Quote
Reply

Viewing: Tutorialized ForumsWeb Design & DevelopmentColdFusion > Simpel problem, butt can't make it work (Coldfusion)


Developer Shed Advertisers and Affiliates


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 | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap