Support » Plugin: WP Photo Album Plus » [Plugin: WP Photo Album Plus] Upload from zip file

  • Resolved noname

    (@aeffemultimedia)


    Hello!

    First of all, thank you very much for this beautiful plugin!

    I have a problem uploading photos in a zip file: after upload I get this error for each photo contained in the zip file:

    Warning: copy() [function.copy]: Unable to access zip:///membri/aeffemultimedia/home/wp-content/wppa-depot/aeffemultimedia/Allee.zip#Allee.jpg in /membri/aeffemultimedia/home/wp-content/plugins/wp-photo-album-plus/wppa-upload.php on line 820

    Anyway zipping should be successful, because I get this notice:
    Zipfile Allee.zip extracted.
    Processing files, please wait… If the line of dots stops growing or your browser reports Ready, your server has given up. In that case: try again here.
    Done processing files.
    1 Zipfiles extracted.

    I tried to find out what was wrong but I don’t know a lot of php so I couldn’t find a solution.

    What could the problem be?

    Thnk you very much,

    aeffemultimedia.

    http://wordpress.org/extend/plugins/wp-photo-album-plus/

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Please mail me an offendig zip (opajaap at opajaap dot nl) so i can see if it is a php or a wppa problem.

    noname

    (@aeffemultimedia)

    The zip file that generates that error is uploaded in my depot at this link: http://aeffemultimedia.altervista.org/home/wp-content/wppa-depot/aeffemultimedia/Allee.zip
    Thank you in advance!

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    I had no problems uploading and unzipping and importing.
    I think your php zip module does not support the zipversion of your files.
    Please check with the hosting provider.

    noname

    (@aeffemultimedia)

    I already uploaded photos in a zip file one moth ago and it worked fine; couldn’t it be a problem with URLs?
    the file has this path: http://aeffemultimedia.altervista.org/home/wp-content/wppa-depot/aeffemultimedia/Allee.zip
    but zip loads this one: zip:///membri/aeffemultimedia/home/wp-content/wppa-depot/aeffemultimedia/Allee.zip#Allee.jpg

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Did you check the settings WordPress address and Aite address in the WP settings general admin page?

    noname

    (@aeffemultimedia)

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    The problem is that aeffemultimedia.altervista.org can not be a part of a pathname, it can only be a part of an url.
    To extract the zip, i must refer the file by its pathname, what you see in an ftp program, that will not be something like ….altervista.org

    So, zip:///membri/aeffemultimedia/home/wp-content/wppa-depot/aeffemultimedia/Allee.zip#Allee.jpg looks to me as being correct.

    Can you pls check Table IX item 5: Allow wppa debugging.
    I can see a little more then.

    Just a try: wppa-upload.php line 459 reads:

    $depoturl = get_bloginfo('url').'/'.$source;	// url

    change it into:

    $depoturl = get_bloginfo('wpurl').'/'.$source;	// url

    (Change ‘url’ into ‘wpurl’)
    It may work (i hope) or make things even worse…

    noname

    (@aeffemultimedia)

    I allowed debugging but I couldn’t see debug outputs;
    changing ‘url’ into ‘wpurl’ didn’t change anything, so I restored ‘url’

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    To see debug output, append &debug or ?debug to the addressline, but it does not work on your site.

    I want to know the values of the constants, you can see them at the first part of the last table in the wppa+ settings admin page.
    Example of what i want to know:

    WPPA_ALBUMS 	Albums db table name. 	wp_wppa_albums
    WPPA_PHOTOS 	Photos db table name. 	wp_wppa_photos
    WPPA_RATING 	Rating db table name. 	wp_wppa_rating
    WPPA_COMMENTS 	Comments db table name. 	wp_wppa_comments
    WPPA_FILE 	Plugins main file name. 	wppa.php
    WPPA_PATH 	Path to plugins directory. 	/mnt/webf/d1/15/51893315/htdocs/opajaap/test/wordpress/wp-content/plugins/wp-photo-album-plus
    WPPA_NAME 	Plugins directory name. 	wp-photo-album-plus
    WPPA_URL 	Plugins directory url. 	http://wppa.opajaap.nl/wp-content/plugins/wp-photo-album-plus
    WPPA_UPLOAD 	The relative upload directory. 	wp-content/uploads
    WPPA_UPLOAD_PATH 	The upload directory path. 	/mnt/webf/d1/15/51893315/htdocs/opajaap/test/wordpress/wp-content/uploads/wppa
    WPPA_UPLOAD_URL 	The upload directory url. 	http://wppa.opajaap.nl/wp-content/uploads/wppa
    WPPA_DEPOT 	The relative depot directory. 	wp-content/wppa-depot/admin
    WPPA_DEPOT_PATH 	The depot directory path. 	/mnt/webf/d1/15/51893315/htdocs/opajaap/test/wordpress/wp-content/wppa-depot/admin
    WPPA_DEPOT_URL 	The depot directory url. 	http://wppa.opajaap.nl/wp-content/wppa-depot/admin
    noname

    (@aeffemultimedia)

    WPPA_ALBUMS	Albums db table name.	avwp_wppa_albums
    WPPA_PHOTOS	Photos db table name.	avwp_wppa_photos
    WPPA_RATING	Rating db table name.	avwp_wppa_rating
    WPPA_COMMENTS	Comments db table name.	avwp_wppa_comments
    WPPA_FILE	Plugins main file name.	wppa.php
    WPPA_PATH	Path to plugins directory.	/membri/aeffemultimedia/home/wp-content/plugins/wp-photo-album-plus
    WPPA_NAME	Plugins directory name.	wp-photo-album-plus
    WPPA_URL	Plugins directory url.	http://aeffemultimedia.altervista.org/home/wp-content/plugins/wp-photo-album-plus
    WPPA_UPLOAD	The relative upload directory.	wp-content/uploads
    WPPA_UPLOAD_PATH	The upload directory path.	/membri/aeffemultimedia/home/wp-content/uploads/wppa
    WPPA_UPLOAD_URL	The upload directory url.	http://aeffemultimedia.altervista.org/home/wp-content/uploads/wppa
    WPPA_DEPOT	The relative depot directory.	wp-content/wppa-depot/aeffemultimedia
    WPPA_DEPOT_PATH	The depot directory path.	/membri/aeffemultimedia/home/wp-content/wppa-depot/aeffemultimedia
    WPPA_DEPOT_URL	The depot directory url.	http://aeffemultimedia.altervista.org/home/wp-content/wppa-depot/aeffemultimedia
    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    This looks ok.

    I think the source of the copy is not a problem, but the desitination.

    Could you please insert the following line just before the copy line (820) in wppa-upload.php:

    wppa_dbg_msg('Trying to copy '."zip://".$path."#".$filename.' to '.WPPA_DEPOT_PATH."/".$fileinfo['basename'], '', 'force');

    This will produce two output lines at the top of the import screen like:

    [WPPA+ dbg msg: Trying to copy zip:///mnt/webf/d1/15/51893315/htdocs/opajaap/beta/wp-content/wppa-depot/admin/Allee.zip#Allee.jpg to /mnt/webf/d1/15/51893315/htdocs/opajaap/beta/wp-content/wppa-depot/admin/Allee.jpg]
    [WPPA+ dbg msg: Trying to copy zip:///mnt/webf/d1/15/51893315/htdocs/opajaap/beta/wp-content/wppa-depot/admin/Allee.zip#Baum im Schlossgarten.jpg to /mnt/webf/d1/15/51893315/htdocs/opajaap/beta/wp-content/wppa-depot/admin/Baum im Schlossgarten.jpg]

    If the output you get is similar as above – with aeffemultimedia/home in all 4 pathnames – try again with all rights (CHMOD 777) on /membri/aeffemultimedia/home/wp-content/wppa-depot/aeffemultimedia

    noname

    (@aeffemultimedia)

    The output is a bit different, also considering to change “opajaap with “aeffemultimedia/home”; this is what I get:

    [WPPA+ dbg msg: Trying to copy zip:///membri/aeffemultimedia/home/wp-content/wppa-depot/aeffemultimedia/Allee.zip#Allee.jpg to /membri/aeffemultimedia/home/wp-content/wppa-depot/aeffemultimedia/Allee.jpg]

    then for the second image it’s the same, only changing filename..

    noname

    (@aeffemultimedia)

    Actually i think the problem is the destination folder, because the warning message destination is different from debug’s output:

    Warning: copy() [function.copy]: Unable to access zip:///membri/aeffemultimedia/home/wp-content/wppa-depot/aeffemultimedia/Allee.zip#Allee.jpg in /membri/aeffemultimedia/home/wp-content/plugins/wp-photo-album-plus/wppa-upload.php on line 821

    noname

    (@aeffemultimedia)

    Sorry, last post was an error..
    Anyway I exlplored my depot and I saw that it was unzipping to be unsuccessful, so I read a bit about PHP & ZIPping.

    I tried to change (ll. 817-820)

    for($i = 0; $i < $zip->numFiles; $i++) {
    	$filename = $zip->getNameIndex($i);
    	$fileinfo = pathinfo($filename);
    	copy("zip://".$path."#".$filename, WPPA_DEPOT_PATH."/".$fileinfo['basename']);

    into
    $zip->extractTo(WPPA_DEPOT_PATH);
    and it works fine..

    Is there any danger?
    Can I keep this new code?
    What’s the difference?

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    What i remember from the time i coded this, is that not all php zip versions support this.
    #pragma: if it works it is ok.
    I will look into the code later and probably update it.
    Thanx for your effort.

    There is only one thing – see the comment at the top of the routine about extracting directories – that it is potentially dangerous.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘[Plugin: WP Photo Album Plus] Upload from zip file’ is closed to new replies.