Not signed in (Sign In)

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

    • CommentAuthoreleven
    • CommentTimeFeb 23rd 2009
     
    Hi there, i'm new in plogger, and i've just installed the 590 trunk.

    I'm starting to test the system, and i can't seem to find the problem with uploading photos in ZIP format.

    After i've uloaded i get this error:
    There were some problems importing the files:

    DSC_0050.jpg: write_error
    DSC_0052.jpg: write_error
    DSC_0054.jpg: write_error

    You can proceed to the Import section to view any files that were successfully uploaded.


    There is nothing in the Import section... Could anyone give me a clue about this?

    TY in advance!.
    •  
      CommentAuthorsidtheduck
    • CommentTimeFeb 23rd 2009
     
    What are the file permissions (CHMOD) of your uploads/ folder?
    • CommentAuthoreleven
    • CommentTimeFeb 23rd 2009
     
    They where 777 and it didn't worked.
    The Import tab had a notice asking me to change it to 755 to improve security, so i did. Still didn't worked.
    • CommentAuthoreleven
    • CommentTimeFeb 23rd 2009
     
    Nevermind, got it.
    First tryes, my ZIP files had OSX file content, so that was why they didn't worked.
    Then, i've done the CMOD to 755 and fixed the ZIP, still didn't Worked.

    i've just CMOD back to 777 and tryed the new ZIP. Works OK!!!

    Thanks for the quick reply!
    •  
      CommentAuthorsidtheduck
    • CommentTimeFeb 23rd 2009
     
    yep, you need to CHMOD the uploads folder to 0777 (on your server) if you are upload .zip archives or importing from the uploads tab. However, if you are not using those, it would be better to CHMOD the folder back to 0755 when you aren't using it (for better security). I modified the code for the next revision so it will give a reminder on the uploads tab for uploading .zip files if the uploads folder is not writeable
    • CommentAuthoreleven
    • CommentTimeFeb 23rd 2009
     
    Now this is odd...
    it worked one time only...
    i just don't get it.
    i'll keep trying.
    • CommentAuthoreleven
    • CommentTimeFeb 23rd 2009
     
    Got it.

    When i upload a ZIP, plogger creates a new folder to decompress. THAT folder has default 755 CHMOD.

    So it just can't write inside. ¿How can i fix this?
    (My server is running in Safe Mode, and i can't change that.)

    Thanks 4 replying!
    •  
      CommentAuthorsidtheduck
    • CommentTimeFeb 23rd 2009
     
    eleven,

    Which version of Plogger are you running? Based on the notices, I thought you were running revision 590 (which should work on safe_mode if you gave your FTP credentials during install, but that would require your server has PHP FTP functions). During install or upgrade were you asked for FTP information?
    • CommentAuthoreleven
    • CommentTimeFeb 23rd 2009
     
    I'm running 590, I've downloaded it just today and made a fresh install, database included.
    During installation, i've provided the FTP info as requested.

    Is there a way to check if PHP is able to use the FTP protocol?
    • CommentAuthoreleven
    • CommentTimeFeb 23rd 2009
     
    I've made a simple PHP to Check the functions avalibility:
    <?php
    if (function_exists('ftp_connect')) { echo "FTP_CONNECT Avalible.<br />\n";} else { echo "FTP_CONNECT Not Avalible.<br />\n";}
    if (function_exists('ftp_mkdir')) {echo "FTP_MKDIR Avalible.<br />\n";} else {echo "FTP_MKDIR Not Avalible.<br />\n";}
    if (function_exists('ftp_chmod')) {echo "FTP_CHMOD Avalible.<br />\n";} else {echo "FTP_CHMOD Not Avalible.<br />\n";}
    ?>


    Response:
    FTP_CONNECT Avalible.
    FTP_MKDIR Avalible.
    FTP_CHMOD Not Avalible.


    So, i think somehow my server doesn't allow ftp CHMOD.
    What do you think?
    •  
      CommentAuthorsidtheduck
    • CommentTimeFeb 24th 2009 edited
     
    Nope, that's not it. I wrote the function to work without ftp_chmod (because it didn't come out until PHP5 and hosts that use safe_mode tend to still be running PHP4). It's an issue with the folder permissions (my bad ... sorry :) ).

    To fix, open plog-admin/plog-upload.php and find the following code (should be around line 64):
    $results = $archive->extract(PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_PATH, $zipdir);
    and change it to read:
    if (is_safe_mode()) {
    chmod_ftp($zipdir, 0777);
    }
    //extract to 'plog-content/uploads/' folder
    $results = $archive->extract(PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_PATH, $zipdir);
    if (is_safe_mode()) {
    chmod_ftp($zipdir);
    }


    That should do it for you! Let me know if it works for you and I'll make sure to add the code to the codebase.
    • CommentAuthoreleven
    • CommentTimeFeb 24th 2009
     
    Works great now!!!!!
    TY so much for the support, I hope this contributes to the improvement of the compatibility.
    I owe you!

    I'll be in touch!
    • CommentAuthornicky77
    • CommentTimeNov 11th 2009
     
    Hi Sid, I have a similar problem. Any folders which I upload to the Uploads folder are assigned 755 permissions, meaning I can't do the the Import unless I manually change them to 777. The Uploads folder has 777 permissions. The fix you mentioned above is already in place in the version I'm using (1.0 RC1), do you have any idea what might be causing this issue? Grateful for any help.
    •  
      CommentAuthorsidtheduck
    • CommentTimeNov 11th 2009
     
    nicky77,

    Yes, if you upload pictures to folders in the "Uploads" folder via FTP, you will have to change the folder permissions to 777 in order to Import them. Basically, it's because when you upload or create a folder via FTP, it is a different user account than that of the PHP script so you are not able to move the files out of that folder without 777 permissions (you would most likely be able to "copy" the images, but not "cut" or "delete" the images within that folder from a PHP script). Does that make sense?
    • CommentAuthornicky77
    • CommentTimeNov 12th 2009
     
    Sid, thanks for the reply. OK that makes sense actually. I wonder if it's possible to use chown() to get round this...may not be possible from the PHP script without using exec().

    A problem I have here though is that even when I manually chmod the folder (in plog-content/uploads) to 777, when I go to import the folder to the gallery it creates an album with the name of the folder, however none of the images are actually moved. If I go to Manage, I can see that a new album has been created but it contains no images. In the import tab, i still see the folder I wanted to create an album with. If I then try again, it will work as this time I am assigning the images to an existing album. Any idea what's going on here? Can't see any permissions issues as all the necessary folders are 777....
    •  
      CommentAuthorsidtheduck
    • CommentTimeNov 12th 2009
     
    Which version of Plogger are you running? 1.0b3 or have you upgraded to 1.0-RC1?

    Just to clear up my understanding of your situation, here is a list of the process you do:
    1. Upload files to "uploads/" folder so they are displayed in the Import tab.
    2. CHMOD newly uploaded folder to 777.
    3. Login and navigate to Import tab.
    4. Attempt to Import pictures.
    5. No pictures imported, but new album and corresponding directory in the "images/" folder are created.
    6. Attempt to import pictures again.
    7. Pictures imported because album / album directory are now existing.

    Is that correct?

    Also, chown() most of the time does not work unless PHP is running as the root superuser (which is definitely not recommended, so then you're back to exec() or shell_exec() which you would still most likely need root credentials). From the PHP manual for chown() -> "Only the superuser may change the owner of a file."
    • CommentAuthornicky77
    • CommentTimeNov 12th 2009
     
    I'm using a clean install of 1.0-RC1. The steps you've outlined are exactly correct. When I set the permissions to 777 on the folder to be imported, I apply it recursively to the images as well and all show correctly as 777 before I try the import. The plog-content/images (and thumbs) folders are also both set to 777.
    •  
      CommentAuthorsidtheduck
    • CommentTimeNov 12th 2009
     
    Do you receive an error after step #4 above?
    • CommentAuthornicky77
    • CommentTimeNov 12th 2009
     
    When I click on the Import tab, I see the folder I want to import. I click on the folder, which then generates the thumbnails of the images inside it. In the "Move photos " field the name of the folder is preselected as the name of the destination album, when I click Submit I am redirected to the Import page (Ithink I get the message that the new album has been created - not sure though as not at my work pc right now), where I can still see the folder there which should have been imported. When I select it again, but this time moving it to an existing album (the empty one just created), the images are moved correctly. So there are no error messages at any stage.
    •  
      CommentAuthorsidtheduck
    • CommentTimeNov 12th 2009
     
    Okay. When you get home, please try this again and see what message is displayed (you said you think you get a message that the new album has been created). I'm just trying to debug where in the code it is being disrupted and the returned output messages will help me to determine that.
    • CommentAuthornicky77
    • CommentTimeNov 12th 2009
     
    Just checked there - ok, so when I click on the folder in the Import section, the thumbs are generated - then I click on the Import button (in the Destination form), which should import to a new album with the name of the folder - when I click this button, I get the message - "Would you like to import anything else? ", which shows the same folder, along with another folder called All Pictures (which contains the same images as the other folder). To make sure the images are imported, I have to click on the folder again, which repeats the process of creating thumbs, but this time correctly moves the images to the (existing) destination folder. Is this the expected behaviour?
    •  
      CommentAuthorsidtheduck
    • CommentTimeNov 12th 2009
     
    No this is not the expected result. Is there any way you can email me temporary FTP access to your host to do some tests? You can email it to sidtheduck SPLAT gmail DOT com and then delete or change the account credentials after I have finished testing.
    • CommentAuthorTriinKK
    • CommentTimeJun 15th 2010
     
    I'm also having a problem.

    When I try to upload a zip file it says

    "Notice: Only variables should be assigned by reference in /~/www/soblajobla.host-ed.net/plog-includes/lib/pclzip-2-4/pclzip.lib.php on line 233

    Warning: Cannot modify header information - headers already sent by (output started at /~/www/soblajobla.host-ed.net/plog-includes/lib/pclzip-2-4/pclzip.lib.php:233) in /~/www/soblajobla.host-ed.net/plog-admin/plog-upload.php on line 88"

    Can anyone give me exact lines what and where I need to change?!