Author Topic: Upload multiple images via *.zip DONE  (Read 80443 times)

0 Members and 1 Guest are viewing this topic.

Offline dipunm

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • london academy yearbook
Upload multiple images via *.zip DONE
« on: July 22, 2005, 09:18:42 PM »
DISCONTINUED.. probably still has bugs too, mite work if u dont expect too much from it
EDITED: (because it was all over the place  :oops:)
UPDATED 02/09/05
Okay, I heard that no one has created the upload via zip file mod... so, i decided to make one  :wink:

Description:

allow users to upload a zip file containing unlimited no of pictures (one category at a time) and the pictures will be extracted, zip file deleted, and the pictures will be added into the database... also, images can be resized, thumbnailed and so on (set using the checkand go settings in admin control panel) during this process.

Install Summary:

Install multiuploadform mod: http://www.4homepages.de/forum/index.php?topic=8517.0
Install checkandgo mod: http://www.4homepages.de/forum/index.php?topic=7245.0
Download: http://www.phpconcept.net/pclzip/index.en.php?PHPSESSID=f4054c78b4c9e9f490267719896a1e55#download and put pclzip.lib.php into the includes folder
From the zip file:
replace member_multiuploadform.html in the template folder
put upload2.php into the includes folder
put the admin_global.php and checkandgo.php files into the gallery's install folder (where index.php would be)
edit the member.php file.


THANKS TO: rroc and deejay_... If it weren't for your mods, i wouldnt be able to do this.

Editing member.php (should be done last)
the member.php file needs to edited so that the multiuploadform can give the sid info...
find:
Code: [Select]
if($action == "multiuploadform" || $action=="multiuploadimage")
  {
  $content = $site_template->parse_template("member_multiuploadform");

and replace with:
Code: [Select]
if($action == "multiuploadform" || $action=="multiuploadimage")
  {
  $content = '<script language="Javascript"> var sid="'.$sid.'" </script> '.$site_template->parse_template("member_multiuploadform");

Known (unsolved) bugs:

    [li]Error for users WITHOUT direct upload permission for the category in question. (1ST PRIORITY)[/li]

    [li]Files with the same filename as an existant image in its category will NOT be uploaded and has to be uploaded individually (working on it)[/li]
    [li]all pages other than the upload form does not use template theme at all.[/li]
    [/list]

    I think thats all, if anyone has any problems or bugs or has a suggestion to make it look better, please be my guest and reply to this post.
    « Last Edit: July 16, 2006, 08:22:57 PM by dipunm »

    Offline Jan Senf

    • Newbie
    • *
    • Posts: 22
      • View Profile
      • event-pics.de und ihr seid dabei !
    Re: Upload multiple images via *.zip DONE
    « Reply #1 on: August 16, 2005, 01:44:32 AM »

    Editing upload2.php
    $uploadDir: change 'gallery' to the actual gallery folder (the folder which you instaled the gallery to: some call it 4images)
    top.location: change 'lc.kurdistanserver.com/gallery' to your website name and install folder


    Great, exactly what Iīm looking for - but unfortunatly after uploading the ZIP i get an error "Page not found" !
    I donīt know whereīs my mistake, the path on the server is "/eventpics/4images/..." and so I add this to the $uploadDir, but after uploading the error page still is on
    "http://www.event-pics.de/includes/upload2.php"
                                         ^^^^^^
    the folder 4images is missing !?

    JanSenf

    Offline dipunm

    • Newbie
    • *
    • Posts: 29
      • View Profile
      • london academy yearbook
    Re: Upload multiple images via *.zip DONE
    « Reply #2 on: August 16, 2005, 02:44:18 PM »
    okay, i went to your website and found your problem... well a differnt problem cause youve tried to edit it.. your form has action="4images/includes/upload2.php" get rid of the 4images bit... so its "includes/upload2.php"  :wink:

    Also, It was my bad thinking that all ftp's were the same :oops:... make $uploadDir read...
    $uploadDir = '/kunden/frankj.de/eventpics/4images/data/media/'.$cat_id.'/';  :wink:

    I think this should fix your problems... try again... and come back with any other bugs

    Offline Jan Senf

    • Newbie
    • *
    • Posts: 22
      • View Profile
      • event-pics.de und ihr seid dabei !
    Re: Upload multiple images via *.zip DONE
    « Reply #3 on: August 16, 2005, 04:17:52 PM »
    okay, i went to your website and found your problem... well a differnt problem cause youve tried to edit it.. your form has action="4images/includes/upload2.php" get rid of the 4images bit... so its "includes/upload2.php"  :wink:

    Ok, this is my fault. Iīve tried so much to make it work !  :(

    Quote
    Also, It was my bad thinking that all ftp's were the same :oops:... make $uploadDir read...
    $uploadDir = '/kunden/frankj.de/eventpics/4images/data/media/'.$cat_id.'/';  :wink:

    I think this should fix your problems... try again... and come back with any other bugs

    Ok, I didnīt get the right server-path !!!!
    Upload is now working, but still there is an other error when working with the ZIP-FILE !

    Look at this...
    Warning:  move_uploaded_file(kunden/frankj.de/eventpics/4images/data/media/3/Kopie_web.zip): failed to open stream: No such file or directory in /kunden/frankj.de/eventpics/4images/includes/upload2.php on line 7

    Warning:  move_uploaded_file(): Unable to move '/tmp/php0kuD0b' to 'kunden/frankj.de/eventpics/4images/data/media/3/Kopie_web.zip' in /kunden/frankj.de/eventpics/4images/includes/upload2.php on line 7
    error:
    Array
    (
        [userfile] => Array
            (
                [name] => Kopie_web.zip
                [type] => application/x-zip-compressed
                [tmp_name] => /tmp/php0kuD0b
                [error] => 0
                [size] => 109598
            )

    )
     
    try again



    Any Idea ?

    TheOracle

    • Guest
    Re: Upload multiple images via *.zip DONE
    « Reply #4 on: August 16, 2005, 07:08:11 PM »
    Quote

    Warning:  move_uploaded_file(kunden/frankj.de/eventpics/4images/data/media/3/Kopie_web.zip): failed to open stream: No such file or directory in /kunden/frankj.de/eventpics/4images/includes/upload2.php on line 7

    Warning:  move_uploaded_file(): Unable to move '/tmp/php0kuD0b' to 'kunden/frankj.de/eventpics/4images/data/media/3/Kopie_web.zip' in /kunden/frankj.de/eventpics/4images/includes/upload2.php on line 7
    error:
    Array
    (
        [userfile] => Array
            (
                [name] => Kopie_web.zip
                [type] => application/x-zip-compressed
                [tmp_name] => /tmp/php0kuD0b
                [error] => 0
                [size] => 109598
            )

    )


    Is your hosting service provides your site under Windows Server ?

    Offline Jan Senf

    • Newbie
    • *
    • Posts: 22
      • View Profile
      • event-pics.de und ihr seid dabei !
    Re: Upload multiple images via *.zip DONE
    « Reply #5 on: August 16, 2005, 08:01:23 PM »
    Quote
    Is your hosting service provides your site under Windows Server ?
    Quote

    No, the FAQ says:

    Linux-/Apacheservern (1.3.X) with modified RedHat-Linux Version

    Offline dipunm

    • Newbie
    • *
    • Posts: 29
      • View Profile
      • london academy yearbook
    Re: Upload multiple images via *.zip DONE
    « Reply #6 on: August 17, 2005, 12:17:17 PM »
    it sounds like the upload directory doesnt exist ($uploadDir) :cry:

    try this... upload this file to your site, run it, and youll get an error... use the error to work out what the location should be..
     if it is the same or if it still dusnt work, try this: "./../data/(blahblahblah)" so that the directory is with respect to the location of the file.
    If it STILL dusnt work, then ill try and investigate further... also, your server is based on what (windows, linux, etc.)

    (the file is .php... i just had to rename it)

    TheOracle

    • Guest
    Re: Upload multiple images via *.zip DONE
    « Reply #7 on: August 17, 2005, 12:23:40 PM »
    @dipunm :

    When I'm trying your attached ZIP file, from your post above, it says that the file is corrupted . . .

    Offline V@no

    • If you don't tell me what to do, I won't tell you where you should go :)
    • Global Moderator
    • 4images Guru
    • *****
    • Posts: 17.849
    • mmm PHP...
      • View Profile
      • 4images MODs Demo
    Re: Upload multiple images via *.zip DONE
    « Reply #8 on: August 17, 2005, 02:45:42 PM »
    @dipunm :

    When I'm trying your attached ZIP file, from your post above, it says that the file is corrupted . . .
    rename it to UnZipper.php ;)
    Your first three "must do" before you ask a question:
    Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
    Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

    TheOracle

    • Guest
    Re: Upload multiple images via *.zip DONE
    « Reply #9 on: August 17, 2005, 08:31:06 PM »
    Indeed. It works.

    Offline Jan Senf

    • Newbie
    • *
    • Posts: 22
      • View Profile
      • event-pics.de und ihr seid dabei !
    Re: Upload multiple images via *.zip DONE
    « Reply #10 on: August 17, 2005, 11:18:25 PM »
    it sounds like the upload directory doesnt exist ($uploadDir) :cry:

    try this... upload this file to your site, run it, and youll get an error... use the error to work out what the location should be..
     if it is the same or if it still dusnt work, try this: "./../data/(blahblahblah)" so that the directory is with respect to the location of the file.
    If it STILL dusnt work, then ill try and investigate further... also, your server is based on what (windows, linux, etc.)

    (the file is .php... i just had to rename it)

    The Server is based an Linux (see my posting above).

    Sorry, I tried this file out but it doesnīt matter where i copy it, i always get an error
    "Parse error: parse error, unexpected T_STRING in /kunden/frankj.de/eventpics/4images/data/media/3/UnZipper.php on line 5"
    (Of course the path is changing to where i copy the file....!!!)

    Or didnīt i get the instructions ???  8O

    Offline dipunm

    • Newbie
    • *
    • Posts: 29
      • View Profile
      • london academy yearbook
    Re: Upload multiple images via *.zip not so DONE
    « Reply #11 on: August 18, 2005, 09:10:27 AM »
    Ive decided my upload form is too rubbish....

    however, my next attempt will be to use the 4images upload script to help me...

    first though, make sure your folder permissions allow you to write to these folders (but i dont see why not)
    and try using:
    define('ROOT_PATH', './../');
    include('./upload.php');
    $uploadDir='/var/www/4images/data/media/'.$cat_id.'/';


    if it still doesnt work, just wait a little longer  :oops:

    Offline dipunm

    • Newbie
    • *
    • Posts: 29
      • View Profile
      • london academy yearbook
    Re: Upload multiple images via *.zip DONE
    « Reply #12 on: August 18, 2005, 10:01:22 AM »
    message to TheOracle

    are you saying the whole thing works, or just the part when you renamed the the file to .php?  :?

    what works?  :oops:

    Offline Jan Senf

    • Newbie
    • *
    • Posts: 22
      • View Profile
      • event-pics.de und ihr seid dabei !
    Re: Upload multiple images via *.zip not so DONE
    « Reply #13 on: August 18, 2005, 11:03:06 AM »
    Ive decided my upload form is too rubbish....

    however, my next attempt will be to use the 4images upload script to help me...

    first though, make sure your folder permissions allow you to write to these folders (but i dont see why not)
    and try using:
    define('ROOT_PATH', './../');
    include('./upload.php');
    $uploadDir='/var/www/4images/data/media/'.$cat_id.'/';


    if it still doesnt work, just wait a little longer  :oops:

    ok, i will wait ...!  8O

    ... but the coding will be easier if the instructions were a little more clearer ...
    sometimes i donīt understand which line in which file i have to edit, and iīm not new to php (but also no professional) or 4images and it is not the first MOD or Change i make  :oops:

    Is there anybody who installed this "MOD" and gets that thing working ?  :roll:

    Offline dipunm

    • Newbie
    • *
    • Posts: 29
      • View Profile
      • london academy yearbook
    Re: Upload multiple images via *.zip DONE
    « Reply #14 on: August 18, 2005, 04:24:44 PM »
    did u try to put the code above in first?...replace:
    $uploadDir = '
    (the whole of the line)
    with the code in bold form my last post... try this first because i dont see why it shouldn't work