Skip to main content
February 2, 2012
Question

Upload file <input type="hidden"> to server

  • February 2, 2012
  • 2 replies
  • 2740 views

I have a file that is on a user machine. The file is always in the same location. I want to have the user click on an upload button without selecting a file and have it sent to the server for processing. I have tried to use <input type="hidden" name="fileupload" value="c:\filepath">. When I run it this way I get no file found. Please help!

    This topic has been closed for replies.

    2 replies

    Owainnorth
    Inspiring
    February 2, 2012

    WOW. There's so much lack of understanding in what you're trying to do it's untrue, I'd respectfully suggest you do some reading up on HTML forms before continuing with whatever project it is that you're working on.

    February 2, 2012

    I admit this is only my second attempt at using coldfusion but I don't see how that  causes a lack of understanding of forms. I have tried to do this without using a form but was told it required a form variable. It should be a pretty simple process. The user scans items with a usb scanner, then plugs the scanner into the computer. The items scanned are saved in a text file. They will then go to the order entry page and hit upload. Since the file is always named the same and in the same location they shouldn't have to do anything more than that.

    Owainnorth
    Inspiring
    February 2, 2012

    It's got nothing to do with ColdFusion, do you not see the issue with web pages being able to grab any files they fancy from your hard disk and take copies of them without your knowledge?

    Community Expert
    February 2, 2012

    For blindingly obvious security reasons, HTML forms will not allow you to do this. The user must manually select the file. You could potentially circumvent this by using something other than HTML for your forms, such as ActiveX or Java, but in general this would be a bad idea.

    Dave Watts, CTO, Fig Leaf Software

    Dave Watts, Eidolon LLC
    February 2, 2012

    The file does not change, it will always be in the same location with the same name. I am trying to keep the user from having to select the file. I'm not sure why its a security risk if I am the one choosing what is uploaded.

    Owainnorth
    Inspiring
    February 2, 2012

    I'm not sure why its a security risk if I am the one choosing what is uploaded.

    You are joking, right?