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

0 Members and 1 Guest are viewing this topic.

Offline Jan Senf

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • event-pics.de und ihr seid dabei !
Re: Upload multiple images via *.zip DONE
« Reply #15 on: August 18, 2005, 05:52:53 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

Ok, i´ve changed the code in the includes/upload2.php to your "bold" code ...

After uploading a test zip there is a known error:

Warning:  move_uploaded_file(/var/www/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 12

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

)
 
try again


Line 12 is the following code:
Code: [Select]
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadFile))

 8O

Offline dipunm

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • london academy yearbook
Re: Upload multiple images via *.zip DONE
« Reply #16 on: August 18, 2005, 06:32:04 PM »
could you please post the whole php file plz?
id like to make sure it is correct

THANX

Offline Jan Senf

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • event-pics.de und ihr seid dabei !
Re: Upload multiple images via *.zip DONE
« Reply #17 on: August 22, 2005, 12:31:00 PM »
could you please post the whole php file plz?
id like to make sure it is correct

THANX

ok, here´s my upload2.php ...

Code: [Select]
<?php

if (isset($cat_id)){
// $uploadDir = 'kunden/frankj.de/eventpics/4images/data/media/'.$cat_id.'/';

define('ROOT_PATH''./../');
include(
'./upload.php');
$uploadDir='/4images/data/media/'.$cat_id.'/';

$uploadFile $uploadDir $_FILES['userfile']['name'];
print 
"<pre>";
if (
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadFile))
{
 include(
'pclzip.lib.php');
  $archive = new PclZip($uploadFile);
  if ($archive->extract(PCLZIP_OPT_PATH$uploadDir,
                        PCLZIP_OPT_REMOVE_ALL_PATH) == 0) {
    die("Error : ".$archive->errorInfo(true));
  }
 
unlink($uploadFile);

?>

<script language="javascript">
top.location='http://www.event-pics.de/4images/checkandgo.php?sid=<?php print "$sid?>&cat_id=<?php print "$cat_id?>'
</script>
<?php
}
else
{
?>

error:
<?php 
print_r
($_FILES);
?>

try again
<form enctype="multipart/form-data" action="upload2.php" method="POST">
    <!-- MAX_FILE_SIZE must precede the file input field -->
    <input type="hidden" name="MAX_FILE_SIZE" value="3000000" />
<input type="hidden" name="cat_id" value="2" />
    <!-- Name of input element determines name in $_FILES array -->
    Send this file: <input name="userfile" type="file" />
    <input type="submit" value="Send File" />
</form>
<?php
}
print 
"</pre>";
}else
{
?>

<!-- The data encoding type, enctype, MUST be specified as below -->
<form enctype="multipart/form-data" action="upload2.php" method="POST">
    <!-- MAX_FILE_SIZE must precede the file input field -->
    <input type="hidden" name="MAX_FILE_SIZE" value="3000000" />
<input type="hidden" name="cat_id" value="2" />
    <!-- Name of input element determines name in $_FILES array -->
    Send this file: <input name="userfile" type="file" />
    <input type="submit" value="Send File" />
</form>
<?php
}
?>



Offline dipunm

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • london academy yearbook
Re: Upload multiple images via *.zip DONE
« Reply #18 on: August 22, 2005, 06:39:23 PM »
Okay, I think I've found an all round solution... with this new upload2.php only 2 changes are needed:

1)  line 60 (in the new upload2.php file) reads:
Code: [Select]
top.location='http://lc.kurdistanserver.com/gallery/checkandgo.php?sid=<?php print "$sid?>&cat_id=<?php print "$cat_id?>'simply edit this to read the directory of YOUR website... (like you did in the previous file)
and then replace the original upload2.php file in your includes folder.

2)  in the member_multiuploadform.html file in the templates directory:
find:
Code: [Select]
<input type="file" name="userfile" class="input" />replace with:
Code: [Select]
<input type="file" name="media_file" class="input" />
The code has been taken from the original members.php file and edited so if you can upload individual images in 4images, then you should be able to do the same here (fingers crossed :mrgreen:)

please post back whether it works or not just so I can know whether it works

the great thing about it, (and the bit that might fix your problem) ist that it doesn't need to know the FULL directory to the upload directory, just the relative directory

Offline Jan Senf

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • event-pics.de und ihr seid dabei !
Re: Upload multiple images via *.zip DONE
« Reply #19 on: August 22, 2005, 10:41:11 PM »
Okay, I think I've found an all round solution... with this new upload2.php only 2 changes are needed:

1)  line 60 (in the new upload2.php file) reads:
Code: [Select]
top.location='http://lc.kurdistanserver.com/gallery/checkandgo.php?sid=<?php print "$sid?>&cat_id=<?php print "$cat_id?>'simply edit this to read the directory of YOUR website... (like you did in the previous file)
and then replace the original upload2.php file in your includes folder.

 ???????  8O

Offline dipunm

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • london academy yearbook
Re: Upload multiple images via *.zip DONE
« Reply #20 on: August 23, 2005, 09:15:14 AM »
in the attachment from my last post, on line 60 (once you've exctracted the file):
Code: [Select]
top.location='http://lc.kurdistanserver.com/gallery/checkandgo.php?sid=<?php print "$sid?>&cat_id=<?php print "$cat_id?>'
change to:
Code: [Select]
top.location='http://www.event-pics.de/4images/checkandgo.php?sid=<?php print "$sid?>&cat_id=<?php print "$cat_id?>'
You did it before, which part of that was confusing???  :?
well, hope this clears it up :wink:

Offline Jan Senf

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • event-pics.de und ihr seid dabei !
Re: Upload multiple images via *.zip DONE
« Reply #21 on: August 23, 2005, 04:36:28 PM »
You did it before, which part of that was confusing???  :?
well, hope this clears it up :wink:

I didn´t understand the instructions - i didn´t get it that´s so easy ...!?

Ok, changes made, but for some reason i get this....
Ok, it´s a little better than the last try, but it do not work...

error:
Array
(
    [media_file] => Array
        (
            [name] => Kopie_web.zip
            [type] => application/x-zip-compressed
            [tmp_name] => /tmp/phpW5lnhb
            [error] => 0
            [size] => 109598
        )

)
 
try again



Offline dipunm

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • london academy yearbook
Re: Upload multiple images via *.zip DONE
« Reply #22 on: August 25, 2005, 11:57:37 AM »
ok... CONFUSION...

the error you posted comes from my old upload2.php file... did u replace this with the new one inside the zip folder (attachment)? :?
I'll post the attachment again but did you read the instructions properly?

1) download the attachment and exctract it
2) in the upload2.php file (the new one found inside the zip folder):
    find:
   
Code: [Select]
    top.location='http://lc.kurdistanserver.com/gallery/checkandgo.php?sid=<?php print "$sid?>&cat_id=<?php print "$cat_id?>'
   
    change to:
   
Code: [Select]
    top.location='http://www.event-pics.de/4images/checkandgo.php?sid=<?php print "$sid?>&cat_id=<?php print "$cat_id?>'
   
3) in the member_multiuploadform.html (found in the templates folder):
    find:
   
Code: [Select]
    <input type="file" name="userfile" class="input" />
   
    replace with:
   
Code: [Select]
    <input type="file" name="media_file" class="input" />
   
NOTE: I've just realised that you put both upload forms into the upload page... this means that you will have to search from the bottom going up and replace only the first one you find

Offline urmasmuld

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: Upload multiple images via *.zip DONE
« Reply #23 on: August 25, 2005, 12:24:09 PM »
I've got this error. What could be wrong? :?
Code: [Select]
Warning: Invalid argument supplied for foreach() in /4images/checkandgo.php on line 332

Offline dipunm

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • london academy yearbook
Re: Upload multiple images via *.zip DONE
« Reply #24 on: August 25, 2005, 12:54:57 PM »
the only suggestion i can think of is reinstall the checkandgo mod... you'll otherwise have to ask this question here http://www.the-deejay.com/mantis/bug_report_page.php (if you need username and password then it is user:4images pass:4images) or here http://www.4homepages.de/forum/index.php?topic=7245.0 because i simply use this mod, i didnt make it :?

TheOracle

  • Guest
Re: Upload multiple images via *.zip DONE
« Reply #25 on: August 25, 2005, 01:16:43 PM »
Quote

Warning: Invalid argument supplied for foreach() in /4images/checkandgo.php on line 332


I assume you're using Windows Server ?

TheOracle

  • Guest
Re: Upload multiple images via *.zip DONE
« Reply #26 on: August 25, 2005, 01:24:07 PM »
If I could be of assistance on this one.

Since the following goes into a PHP file, it could also be validated through sessions

from :

Quote

top.location='http://www.event-pics.de/4images/checkandgo.php?sid=<?php print "$sid" ?>&cat_id=<?php print "$cat_id" ?>'


to :

Code: [Select]

top.location=''.$site_sess->url(ROOT_PATH.'checkandgo.php?sid=".$sid."&cat_id=".$cat_id.").''


;)

Offline jkn

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Upload multiple images via *.zip DONE
« Reply #27 on: August 25, 2005, 04:28:41 PM »
Yeha, it’s a really great mod!!! and thx for your great work!

but one question: I’ve added the last code and the second upload2.php with the alternative code from theOracle

Quote
top.location=''.$site_sess->url(ROOT_PATH.'checkandgo.php?sid=".$sid."&cat_id=".$cat_id.").''

but the java-script doesn’t have any effect!??? the files are in the right folder, but not in the database!!?? and they are not resized and visible! The only what i see is an java-skript error!
on this url: http://www......de/images/includes/upload2.php

Fehler:    Syntaxfehler
Zeile:      4
Zeichen:   28

Zeile 4 is:   define('ROOT_PATH', './../');

redirect doesn’t work?!?

hmm... thx and sorry for my bad english  :oops:
jkn

TheOracle

  • Guest
Re: Upload multiple images via *.zip DONE
« Reply #28 on: August 25, 2005, 04:40:27 PM »
Quote

/images/includes/upload2.php


should be :

Code: [Select]

includes/upload2.php


As for your images, it should go in your templates/<your_template>/images path.

;)

Offline jkn

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Upload multiple images via *.zip DONE
« Reply #29 on: August 25, 2005, 04:46:06 PM »
 :lol:

öhm no_oo oracle, 4images is installed in the /images/ folder!!

by
jkn