Uploading a file with a Preview Page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arno14843
    New Member
    • Jun 2007
    • 2

    Uploading a file with a Preview Page

    Alright well heres my issue, I'm trying to create a preview page for a form we currently use on our website. The only problem I have is right now we have the <input type="file"> field on one page.. it goes to the preview page if so desired and then we have a page that actually takes care of the upload once the user selects submit on the preview page. This seems all fine and well the problem is I can't find a way to pass the file information to from the beginning page to the upload page because without directly going to the page that handles uploading there is a temporary file created and I can't figure out how to get the base file from that. We have a restriction of the cffile upload too for only word, powerpoint, and excel files.

    Any help would be great thanks.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Welcome to TSDN!

    Have you seen this article?

    If you still have problems, can you please post your code.

    Comment

    • arno14843
      New Member
      • Jun 2007
      • 2

      #3
      Alright yeah I did read that, and didn't really address the issue

      basically this is what I have on one page:

      Code:
      <input name="annFile" type="file" size="48" id="annFile">
      on the preview page:

      Code:
      <input type="hidden" name="annFile" value="#FORM.annFile#" />
      which is just used to pass information along

      and on the action page:

      Code:
      <cffile action="upload" filefield="annFile" destination="#fileUploadDir#" accept="application/vnd.ms-word,application/msword,application/pdf,application/vnd.ms-excel,application/vnd.ms-powerpoint" nameconflict="makeunique" result="annUpload">

      The problem is when it encounters the action page it is using the temp file and that isn't being accepted... nor do I want the temp file to be uploaded I want the actual file to be uploaded.

      If you can assist that would be more than appreciated.

      Thanks.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        During file upload, the file is already uploaded by the time it comes across cffile. A preview is not possible without an upload anyway. So I would suggest that you upload on the preview page. The upload page would confirm the upload by storing the path in the database or whatever. If it's not to be uploaded, you can delete it.

        Comment

        Working...