Skip to main content
November 19, 2009
Question

Cffile Destination on Other server in Redhat Server

  • November 19, 2009
  • 1 reply
  • 1051 views

How can i set my destination in cffile for destination located at different server? (Red Hat Enterprise Server)

<cfset rootdirectoryUpload_w = "192.168.128.210/db/UploadFolder/projectx/">
<cfset rootdirectoryUpload_v = "192.168.128.210/db/UploadFolder/projectx/">

<cfif directoryexists(rootdirectoryUpload_w)>
    <cfelse>
    <!--- Create this folder --->
    <cfdirectory action = "create"
    directory = "#rootdirectoryUpload_w#">
    </cfif>

<cffile destination="#rootdirectoryUpload_w#" action="UPLOAD" nameconflict="MAKEUNIQUE" filefield="aimage"
                     accept="image/gif, image/jpeg, image/jpg, image/pjpeg, image/bmp">

-------------HTML-----------

<cfif fileexists(uploadimage_name)>

   <a href="javascript:newWindow=window.open('#rootdirectoryUpload_v#/#urlencodedformat(qDetail.MVARIANTIMG)#', 'openWn', 'toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1'); newWindow.focus();">#qDetail.MVARIANTIMG#</a><br>
   <font color="c0c0c0">* Click the file name to view</font>
             <cfelse>
             File Not Available
   </cfif>

-------------HTML-----------

From the code above, i can successfully upload, but the uploaded file i can't find it, don't know where it gone.

From the HTML part, i try to view back the file but it can't point me to the file that i uploaded.

ANyone can help?

    This topic has been closed for replies.

    1 reply

    Inspiring
    November 19, 2009

    DOM_CF,

    Do you have the appropriate write permissions for the directory (for which you are trying to upload the files)?.

    November 19, 2009

    i'm not so sure too, i'm very new in installing CF in Redhat, can anyone show me some example? Most of the example i get from NET are windows platform which is not working for redhat.

    Inspiring
    November 19, 2009

    In your case, your destination directory is "projectx" and you need to set the permission as,

    chmod 777 projectx

    And you can always refer the CF documentation here,

    http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00001616.htm

    HTH