After file upload, how do u store the path to database?

Discussion in 'Programming' started by unitedlocalbands, Aug 8, 2007.

  1. #1
    I'm trying to figure out how to store the path to the file that gets uploaded.
    I tryed passing the path to another form on a different page, but I can only retireve the path to the directory and not completely to the file.



    
    
    <cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
    
    <cfoutput>
    <cfif isdefined("form.upload_now")>
    <cfset uploadPath = GetDirectoryFromPath(GetTemplatePath()) & "#HELLO.USERID#\">
      <cfif not DirectoryExists(uploadPath)>
        <cfdirectory action="create" directory="#uploadPath#">
      </cfif>
    <cffile accept="image/gif, image/jpeg, image/pjpeg, text/html, application/msword" action="upload" 
    destination="#uploadPath#" filefield="ul_path" nameconflict="makeunique">
    The file was successfully uploaded!
    <a href="savepath.cfm?uploadpath=<cfoutput>#form.ul_path#</cfoutput>">Click here to finnish</a>
    </cfif>
    
    </cfoutput>
    
    
    <form action="<cfoutput>#CurrentPage#</cfoutput>" method="POST" name="upload_form" enctype="multipart/form-data" id="upload_form">
    <input type="file" name="ul_path" id="ul_path">
    <input type="submit" name="upload_now" value="submit">
    <input type="hidden" name="MM_InsertRecord" value="upload_form">
    </form>
    
    
    Code (markup):
     
    unitedlocalbands, Aug 8, 2007 IP
  2. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    cfStarlight, Aug 11, 2007 IP