Hi Gary--here's what I sent out yesterday about this. Matt
---------- Forwarded message ---------- From: Matt Woodward <[EMAIL PROTECTED]> Date: Mon, 21 Feb 2005 08:48:33 -0600 Subject: Re: File Upload... To: [email protected] Couple points of clarification. First, cffile is the tag that's used on the form processing page or in the form processing CFC that handles the actual file upload, so you wouldn't use cffile within a cfform. You're on the right track with using input type="file" on your form. The next step is to use cffile on the form processing page to handle the upload. So first you have to set up your form in a particular way so that it knows you're going to be uploading a file. Here's a very simple example: <form action="uploadFile.cfm" method="post" enctype="multipart/form-data"> <input type="file" name="myFile" /><br /> <input type="submit" value="Upload File" /> </form> Note specifically the enctype="multipart/form-data" in the form tag. Without this the server won't know you're trying to upload a file. On the processing page you would use cffile and tell it where to put your file. <cffile action="upload" filefield="myFile" destination="C:\myuploads" /> This is the minimal code you'll need to get a file uploaded. Note that the destination value is a path on the server's hard drive, NOT a relative or absolute URL. There are all sorts of other things you can do with file uploads such as limiting the types of files that are accepted, the size of file that is accepted, tell it how to handle name conflicts between uploaded files, etc. but this should get you going. For full details check out the livedocs on macromedia.com. Hope that hleps, Matt On Mon, 21 Feb 2005 08:32:24 -0600, Alford, Gary L <[EMAIL PROTECTED]> wrote: > > I am trying to develop some code that is capable of uploading video files to > a specific subdirectory location on the server (please note that I have > never tried this before - a first time for everything). I have tried a > standard HTML form with <input type=file... and I have tried a CFML form > with <CFFILE>. I can't get either one to work. > > Has anyone out there done this (I'm sure there is) and what is the best / > easiest way to accomplish this? > > Any information would be greatly appreciated. > ________________________________ > > Gary L. Alford > Manufacturing Operations Project Specialist > Bell Helicopter XWorx > Phone: (817) 280-6233 Fax: (817) 278-6233 > [EMAIL PROTECTED] > > I have not failed. I've found 10,000 ways that won't work. > Thomas A. Edison ________________________________ > > > > -- Matt Woodward [EMAIL PROTECTED] http://www.mattwoodward.com -- Matt Woodward [EMAIL PROTECTED] http://www.mattwoodward.com ---------------------------------------------------------- To post, send email to [email protected] To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm
