Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

cffile upload not working

Posted on 2009-04-03
7
Medium Priority
?
624 Views
Last Modified: 2012-05-06
I have simple cffile upload that is not working below is the code:
The file is saved a test server where I work on and not my local drive. When I submit this the browser simply gives me blank screen. I checked on the destination and there is is none. I checked on the #form.AddManual# and it displayed the name of the file. Now, why is it not uploading. Thanks in Advance.
<cfform name="AddAcc" action="Maintain.cfm?MPT=Acc.cfm" method="post"> 
Attach Manual<cfinput type="File" name="AddManual" size="100" 
<cfinput type="submit" name="AddAcs" value="Add Accessories">
</cfform>
<cffile action="upload" filefield="#form.AddManual#" destination="Z:\TimeWeb\PDF\" nameconflict="OVERWRITE">

Open in new window

0
Comment
Question by:aentice
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 15

Expert Comment

by:Tomarse111
ID: 24060890
The code below works fine for me, obviously my #uploadPath# points to my upload dir. You were missing a enctype="multipart/form-data" in the cfform, so that might be it.
<cfif Isdefined("AddManual")>
	<cffile action="upload" filefield="AddManual" destination="#uploadpath#" nameconflict="OVERWRITE">
</cfif>
 
 
 
<cfform name="AddAcc" enctype="multipart/form-data" method="post"> 
	Attach Manual <cfinput type="File" name="AddManual" size="100" >
	<cfinput type="submit" name="AddAcs" value="Add Accessories">
</cfform>

Open in new window

0
 
LVL 15

Accepted Solution

by:
Tomarse111 earned 2000 total points
ID: 24060892
Also your filefield="AddManual" doesn't need hashes in it.
0
 

Author Comment

by:aentice
ID: 24062780
It doesn't work for me. This is what I did and I created a new page with just this simple code and it gives me an empty page, no error displayed. No file also created on the specified location.
<cfif IsDefined("form.AddManual")>
<cffile action="upload" filefield="AddManual" destination="C:\TimeWeb\PDF\" nameconflict="OVERWRITE">
asdfsadf
</cfif>
<cfform name="AddAcc" enctype="multipart/form-data" method="post" action="MainCont.cfm?MPT=Acc.cfm">
Attach Manual <cfinput type="File" name="AddManual" size="100" >
      <cfinput type="submit" name="AddAcs" value="Add Accessories">
</cfform>
0
Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

 

Author Comment

by:aentice
ID: 24062902
I tested it some more and the error comes from here. When I remove this line then it displays the
 text asadf.
<cffile action="upload" filefield="AddManual" destination="C:\Time\PDF\" nameconflict="OVERWRITE">
0
 
LVL 15

Expert Comment

by:Tomarse111
ID: 24063948
what does the action do on the form? If you're submitting to the same page you don't actually need an action on the form ..
0
 
LVL 15

Expert Comment

by:Tomarse111
ID: 24064070
Also do you have write permissions on the dir you're trying to write to e,g C:\TimeWeb\PDF\. Have you ever managed to write any files to it from you CF pages?
0
 

Author Comment

by:aentice
ID: 24077534
The action does go to same page and I changed all permissions to write.
Extra question: If I'm in my local why would I need to change these permissions?
This code still do not save anything on my drive. And after I submitted file I get a blank screen.
<cfform name="AddAcc" enctype="multipart/form-data" method="post">
      Attach Manual <cfinput type="File" name="AddManual" size="100" >
      <cfinput type="submit" name="AddAcs" value="Add Accessories">
</cfform>
<cfif IsDefined("form.AddManual")>
asdfsadf
<cffile action="upload" filefield="AddManual" destination="C:\LIVE\Time\PDF\">
sdfgdfg
</cfif>
0

Featured Post

Setting up LaraDock for Laravel

Learn how to set up LaraDock in a Laravel project - LaraDock gives us an easy way to run a Laravel application using Docker in a single command.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question