The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 2 of 2

Thread: Coldfusion: CFFILE

  1. #1

    Coldfusion: CFFILE

    I'm making a site using CFFILE to upload pictures to the server! I have a questions about this! I'm using the following CFFILE Script:
    Code:
    <CFIF isdefined ("FORM.txt_addTN")>
    <CFIF VAL(CGI.CONTENT_LENGTH) GT 60000>
    <cfset Note="Your File is too Large! (#VAL(CGI.CONTENT_LENGTH/1000)# KB)">
    <cfelseif form.UploadTN EQ ''>
    <cfset Note="You did not select a photo.">
    <CFELSE>
    <CFFILE 
     ACTION="Upload" 
     FILEFIELD="UploadTN" 
     DESTINATION="/home/httpd/vhosts/polisproperty.com/httpdocs/thumbnails/" 
     NAMECONFLICT="makeunique"
     ACCEPT="image/*">
    <cfquery name="rsInsertTN" datasource="Polisproperties">
    INSERT INTO sPhotos (homeID, photoName, thumbnail) VALUES (#session.homephoto#,"#cffile.ServerFileName#.#cffile.ServerFileExt#",1) 
    </cfquery>
    <cflocation addtoken="no" url="add_photos.cfm?home=#session.homephoto#">
    <CFABORT>
    </CFIF>
    </CFIF>
     
    <CFIF isdefined ("FORM.txt_add")>
    <CFIF VAL(CGI.CONTENT_LENGTH) GT 120000>
    <cfset Note="Your File is too Large! (#VAL(CGI.CONTENT_LENGTH/1000)# KB)">
    <cfelseif form.UploadMe EQ ''>
    <cfset Note="You did not select a photo.">
    <CFELSE>
    <CFFILE 
     ACTION="Upload" 
     FILEFIELD="UploadMe" 
     DESTINATION="/home/httpd/vhosts/polisproperty.com/httpdocs/photos/" 
     NAMECONFLICT="makeunique"
     ACCEPT="image/*">
    <cfquery name="rsUpdate" datasource="Polisproperties">
    INSERT INTO sPhotos (homeID, photoName, description) VALUES (#session.homephoto#,"#cffile.ServerFileName#.#cffile.ServerFileExt#","#form.description#") 
    </cfquery>
    <cflocation addtoken="no" url="add_photos.cfm?home=#session.homephoto#">
    <CFABORT>
    </CFIF>
    </CFIF>
    On the website the photo's are showing one at a time with next and previous buttons! Is there a way to influence which picture showes first? I tried eveything but every time it show a picture first that I actualy don't want

    Thank you all in advance

  2. #2
    151
    posts
    Registered User
    i'm assuming that you querying the db to get the pictures back right? If so, you couold just sort the photo's according to when they where uploaded?? What is the condition that you trying to view the 1st photo?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012