Skip to main content
Inspiring
January 19, 2012
Question

file Upload from images stored in server

  • January 19, 2012
  • 2 replies
  • 1135 views

I have some photos that are store on a webserver. my form has the input type="file". I want to be able to search for my images which are stored in the server and not on my local computer. Am i using the right form tag?

    This topic has been closed for replies.

    2 replies

    BKBK
    Community Expert
    Community Expert
    January 19, 2012

    As the photos are on a remote server (yours?), the ColdFusion tag to use is cfftp. In other words, ensure that the server is running FTP-server software.

    However, if searching is all you want to do, then why re-invent the wheel? What I would do is use an FTP client like FileZilla or WinSCP. They are both free, have search facilities, and they require you to write zero code.

    Inspiring
    January 20, 2012

    Thanks for your help. I'm familiar with filezilla and winscp. I guess what I'm trying to say is I want to insert and store the full path to a row in my mysql database pointing a folder where my image are stored (which is on the server). By using the input type= file I thought that I could search for the image from within the server but I only opens showing what on my local computer. Am I using the wrong form tag?

    Community Expert
    January 20, 2012

    Yes, you are using the wrong form tag. There is no "right" form tag for this, you'll have to build output as I described in my previous response. You don't need CFFTP or anything like that for this either. You already have a list of files on your server. Read that list using a database query, then use CFOUTPUT to generate the list within the context of whatever HTML form field (other than INPUT TYPE="FILE", which is again specifically for uploading files from the client).

    Dave Watts, CTO, Fig Leaf Software

    Dave Watts, Eidolon LLC
    Community Expert
    January 19, 2012

    That field is for uploading files from your local computer to the web server. There is no HTML form tag that is designed to allow you to browse the web server, but you can build an HTML interface that shows files from your web server. For example, you could use CFDIRECTORY to build a query object containing all the files in a single directory, then use CFOUTPUT to output that as a list of some sort.

    Dave Watts, CTO, Fig Leaf Software

    Dave Watts, Eidolon LLC