Skip to main content
Participant
September 10, 2012
Question

CFFILE Upload Linux Folder permission Issue

  • September 10, 2012
  • 1 reply
  • 616 views

Hey guys!  I'm trying to get my CFFILE upload code to work properly on a linux environment.  Unfortunately, it seems to only work as far as uploading when I set the permissions of the directory to "777".  I really don't want to open it up that much.  Is this something I'm stuck with or is there another way of addressing this issue?  See code below...thanks so much!

<html><head><title>Upload File with Coldfusion</title></head><body>

<cfif isdefined("form.submit_upload")>

<cffile action="UPLOAD" filefield="file_path" destination="#file_dir#" nameconflict="MAKEUNIQUE" mode="777">

<strong><font color="red">File Uploaded!</font></strong>

</cfif>

<form action="index.cfm" method="POST" name="frmupload" enctype="multipart/form-data">

<H4>Upload a File</h4><br>

<h5>Coldfusion upload

<br><br>

Enter file path for upload:<br><br>

<input type="text" name="file_dir"><br><br>

Select file to upload:<br><br>

<input type="file" name="file_path"><br><br>

<input type="submit" name="submit_upload" value="upload">

</form>

</body></html>

    This topic has been closed for replies.

    1 reply

    Miguel-F
    Inspiring
    September 10, 2012

    Remember that your CF instance is running as a user.  What rights does that user have to your upload folder?  Perhaps that will shed some light on it.