AjaxUploader (PHP) and symlinks

Last post 09-23-2010, 1:29 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  09-22-2010, 7:47 AM 64136

    AjaxUploader (PHP) and symlinks

    Goodday Devs of the AJAXuploader,
     
    Today we decided to redo some structures on our webserver and in doing so decided that we'd use a symlink to our webroot and such.
     
    The result; 
    Error: CuteWebUI_AjaxUploader_Initialize is not defined
    Source File: BLOCKED SCRIPTalert('TODO: FIXME')
    Line: 0
     
    Now, don't worry! I fixed it!
     
    The problem is your GetWebPath function (line 223 in include_phpuploader.php).
    The function is pretty nice and thought through, but
     
    __FILE__ (which is the param used for the function) is a REALPATH (so /var/foo/real/path/).
    $_SERVER['SCRIPT_FILENAME'] (which is what is used to refactor the path) is NOT a realpath (so /var/foo/symlink/path/).
     
    The result is a missmatch!
     
    The fix is pretty simple, though I'm not 100% sure if it's flawless,. but it works for me;
     
           $ppath= realpath($_SERVER['SCRIPT_FILENAME']);
           $vpath= realpath($_SERVER['SCRIPT_NAME']);
     
    I wrapped realpath functions around these so that all paths are now the same (realpaths, no symlinks).
     
     
    Hope this is something you can fix for other ppl too,
     
    keep up the good work :)
  •  09-23-2010, 1:29 PM 64164 in reply to 64136

    Re: AjaxUploader (PHP) and symlinks

    rubendevries,

    Thanks for the input.  I've pass this information to the development team.
     
    Thanks again for the help.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML