3 Replies Latest reply on Jul 26, 2006 12:49 PM by umuayo

    Trying to upload multiple files

    jimmylharrell
      This code is working, however none of the fields are required. Basically I'm trying to give the user the option to upload multiple files. But what's happening is that if they upload one file(can upload a total of three) and they don't upload the other two fields I get an error page basially saying nothing has been loaded in fields two and three. But I'm wanting the page to just reload(as it wiould if they uploaded three files). I think it has something to do with me not closing correctly using </cfif>. Anyone's help will be appreaciated.

      <cfif rsUser.Name is not "" >
      <cfif isdefined("form.upload_now")>
      <cffile accept="image/jpeg, image/pjpeg" action="upload" destination="C:\CFusionMX7\wwwroot\winelkhybrid\images\gallery" filefield="ImageName" nameconflict="overwrite">
      <cfquery name="rsGallery" datasource="connCFGallery">
      INSERT INTO Gallery ( ImageName, Approved, Name, Company, Address,
      Address2, City, State, Zip, Phone, Email, Password, Product, Color, Accessories, ReceiveNews) VALUES ( '#File.ServerFile#', '#Form.Approved#', '#Form.Name#', '#Form.Company#', '#Form.Address#', '#Form.Address2#', '#Form.City#', '#Form.State#', '#Form.Zip#', '#Form.Phone#', '#Form.Email#', '#Form.Password#', '#Form.Product#', '#Form.Color#', '#Form.Accessories#', '#Form.ReceiveNews#')
      </cfquery>




      <cffile accept="image/jpeg, image/pjpeg" action="upload" destination="C:\CFusionMX7\wwwroot\winelkhybrid\images\gallery" filefield="ImageName2" nameconflict="overwrite">
      <cfquery name="rsGallery" datasource="connCFGallery">
      INSERT INTO Gallery ( ImageName, Approved, Name, Company, Address,
      Address2, City, State, Zip, Phone, Email, Password, Product, Color, Accessories, ReceiveNews) VALUES ( '#File.ServerFile#', '#Form.Approved#', '#Form.Name#', '#Form.Company#', '#Form.Address#', '#Form.Address2#', '#Form.City#', '#Form.State#', '#Form.Zip#', '#Form.Phone#', '#Form.Email#', '#Form.Password#', '#Form.Product2#', '#Form.Color2#', '#Form.Accessories2#', '#Form.ReceiveNews#')
      </cfquery>



      <cffile accept="image/jpeg, image/pjpeg" action="upload" destination="C:\CFusionMX7\wwwroot\winelkhybrid\images\gallery" filefield="ImageName3" nameconflict="overwrite">
      <cfquery name="rsGallery" datasource="connCFGallery">
      INSERT INTO Gallery ( ImageName, Approved, Name, Company, Address,
      Address2, City, State, Zip, Phone, Email, Password, Product, Color, Accessories, ReceiveNews) VALUES ( '#File.ServerFile#', '#Form.Approved#', '#Form.Name#', '#Form.Company#', '#Form.Address#', '#Form.Address2#', '#Form.City#', '#Form.State#', '#Form.Zip#', '#Form.Phone#', '#Form.Email#', '#Form.Password#', '#Form.Product3#', '#Form.Color3#', '#Form.Accessories3#', '#Form.ReceiveNews#')
      </cfquery>