Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

cfftp not recognizing c:/

New Here ,
May 27, 2009 May 27, 2009

This problem has been stumping me now for a week.

The issue:
I created an upload form on my website, and when i run it on my localhost, I can take my file from c:/mouse.jpg and put it on my FTP site through the below script. But when i run my script on my website which is hosted by GoDaddy it is not recognizing the filepath of C:/mouse.jpg . I get the error : Security: The requested template has been denied access to c:\mouse.jpg.

Godaddy says they aren't blocking any of the commands i am using. http://help.godaddy.com/article/547?

Why can it not recognize my harddrive path?

I know it is connecting to my server correctly because i can execute action = "LISTDIR" on both my localhost and the hosted site.

This has halted my progress of building my website severely! If someone can help me i would be so happy!


<p>Open a connection
<cfftp connection = "myConnection"
username = "myUsername"
password = "myPassword"
server = "ftp.richerconsulting.com"
action = "open"
stopOnError = "Yes"
passive="yes">

<p>Move Image File to Remote Server:<br></p>
<cfftp
connection = "myConnection"
action = "putFile"
name = "uploadFile"
transferMode = "binary"
localFile = "c:/mouse.jpg"
remoteFile = "test/mouse.jpg"
passive="yes"
>
<p>Did MOUSE succeed? <cfoutput>#cfftp.succeeded#</cfoutput>

<p>Close the connection:
<cfftp connection = "myConnection"
action = "close"
stopOnError = "Yes">
<p>Did it succeed? <cfoutput>#cfftp.succeeded#</cfoutput>

673
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 27, 2009 May 27, 2009

Does the account that the ColdFusion service is running under have rights to access to the C:/mouse.jpg file?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 27, 2009 May 27, 2009

Is there a file called mouse.jpg on the c drive of the godaddy computer?  Probably not.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 27, 2009 May 27, 2009

I found out that since this is a shared hosting account, that i can not have access directly to my hardrive from the site.

Is there a workaround that anyone knows for this?

I want to be able to create an upload form eventually on my shared hosting account.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 27, 2009 May 27, 2009

Ask godaddy how they handle ftp and find out what file path you can use.  Then, in your code, add some if/else logic to determine the correct path based on whether or not you are on godaddy or your local machine.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 28, 2009 May 28, 2009
LATEST

The problem was when you have a shared hosting account (as i do) you need to write to a local drive at GoDaddy.

The correct path is:

     <cffile action = "upload"
        fileField = "FileContents"
        destination="D:\Hosting\AlbertRicher" <!--- This is where your destination is! --->
        accept = "image/jpeg, image/pjpeg"
         nameConflict = "MakeUnique">

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources