Not signed in ( Sign In)

Categories

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorviktor
    • CommentTimeAug 29th 2008
     permalink
    hi,

    i've installed vivace (0.804) on a free web host, and i can't upload files ("An error occurred while trying to upload."), although when i used bbcode to scale an ftp'ed image, it created the thumbnail successfully. additionally, using my (more or less) own uploader script i can upload files to the same host, so maybe it's not a restriction on the server side. anyway, my script can be found here in case you need it:

    https://sourceforge.net/projects/phpfb/

    is there any way to fix this? or to investigate on which part of the uploading process the problem occurs? please let me know if there's any info you need

    thanks in advance
    •  
      CommentAuthorNoWhereMan
    • CommentTimeAug 29th 2008
     permalink
    upload is managed in admin/panels/uploader/admin.upload.php (IIRC that's the path) as I'm busy ATM and it sounds like you know your way in PHP, can I ask you if you can investigate further?

    bye
    •  
      CommentAuthorviktor
    • CommentTimeAug 29th 2008
     permalink
    it's quite strange. if i edit that file as

    if (!file_exists("fp-content/images/"))
    fs_mkdir("fp-content/images/");

    if (!file_exists("fp-content/attachs/"))
    fs_mkdir("fp-content/attachs/");


    it works and it creates the needed directories. and of course if i create those two folders before using the uploader, it will also work.
    then i tried

    var_dump(fs_mkdir(IMAGES_DIR));
    exit();


    and the output was

    Warning: realpath() [function.realpath]: Unable to access /somepath/flatpress/fp-content/images/
    in /somepath2/prepend.php(159) : system created function on line 16

    Warning: realpath() [function.realpath]: Unable to access /somepath/flatpress/fp-content/images/
    in /somepath2/prepend.php(159) : system created function on line 16
    bool(false)


    funny thing is that the output is the same for

    var_dump(fs_mkdir("fp-content/images/"));
    exit();


    and yet, it will still work with the code in the first code block. i don't really understand.

    anyway, it's a free webhost, and there may be nasty tweaks to restrict usage or something. so now i'll have to create 2 new folders on each new flatpress install (no better solutions comes to my mind). i think it's a price i can afford :)

    ps: some realpath warnings also appeared when i pressed next on the first page of install, but it doesn't seem to affect usage so far
    •  
      CommentAuthorviktor
    • CommentTimeAug 29th 2008
     permalink
    or maybe attachs and images could be included in the default installation... simple and easy :)
    •  
      CommentAuthorNoWhereMan
    • CommentTimeAug 29th 2008 edited
     permalink
    there may be nasty tweaks to restrict usage or something


    yep they do look like that :) I think you could try and edit your defaults.php and change IMAGES_DIR and ATTACHS_DIR and make them relative paths; this could affect prettyurls, if you use it
    •  
      CommentAuthorviktor
    • CommentTimeAug 29th 2008
     permalink
    i've tried this way:

    define('IMAGES_DIR', 'fp-content/images/');
    define('ATTACHS_DIR', 'fp-content/attachs/');


    but it didn't work. but it's ok, i just created the folders via ftp, and all fine :)
    •  
      CommentAuthorStanley
    • CommentTimeJun 16th 2010 edited
     permalink
    I've just resolved a similar problem - in case this helps anyone who comes looking.

    I was getting the "An error occurred while trying to upload" message but in my case this occurred on a FP installation which I moved to a new location. For whatever reason the attachs & images folder permissions (which were both set to "777" in the original installation) got changed. Changing both of these back to 777 fixed the problem.

    A similar thing happened with old statics and entries - these all reverted to read only when I moved them, so I got the pink error message every time I tried to edit one - statics just couldn't be edited, but entries were actually moved to drafts (i.e. became invisible to the outside world). Changing all of the entries and statics to read/write (CHMOD 666) fixed all of those problems.

    Just something to watch out for if you move your FP installations from one folder to another, or to another server.