Cross-platform Batch Uploading Cross-platform Batch Uploading
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Cross-platform Batch Uploading

Started by mstralka, July 23, 2004, 04:37:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mstralka

Before I discovered coppermine today, I had built my own photo management site which sucks compared to this.  I got sick of uploading files individually, so I found a tool called JUpload http://jupload.biz/ that I used to let my friends upload their photos to their own folders on the site.  It's a java applet that can be integrated into your site and customized by changing the applet parameters.  The documentation (well-written, professional looking PDF) lists all of the parameters and appropriate values.  Anyway, I got this tool to work on my site in about 2 hours, and it made it a lot easier for my friends to upload their photos.

I've read some other posts on this forum that cautions against granting batch upload access to users.  JUpload can use standard HTTP POSTs or GETs to transfer the files to Coppermine's standard upload processing page.  I'm not a lawyer, but I believe JUpload is free for private and educational use, which is what my site is.  For commercial use, the licenses start at $62.

I'm new to Coppermine and I don't know if there is API documentation, but if any experienced Coppermine programmers want to take a stab at making JUpload work with Coppermine, I'd be happy to share what I've done on my personal site.  I'm going to work on it too, so I'll share any progress I make

Take care
Mark

[edit GauGau 2006-01-29]
This mod has been ported for cpg1.4.x as well - see http://forum.coppermine-gallery.net/index.php?topic=27138.0
[/edit]
GO IRISH

Joachim Müller

It can't be bundled with coppermine releases if it's not under GNU GPL, but as third-party app (hack/mod, name it how you like) this sounds interessting. Please keep us updated on the progress you make, some screenshots would be nice as well.

GauGau

mstralka

Is there any API documentation for CPG or should I just look at upload.php and figure out where to make changes?
GO IRISH

Joachim Müller

there's no API documentation available publicly yet, sorry (Tarique is currently working on this). You could just take a look at the db entries in the pictures table to see what queries to produce. You will have to check the authentification mechanisms (init.inc.php and functions.inc.php basically) as well.

GauGau

Tarique Sani

I really had liked Jupload when I had last seen it almost a year ago- pity it is commercial.  Take a look at upload.php - it is just a matter of providing correc parameters to the function add_picture() (which is written in picmgmt.inc.php)

SANIsoft PHP applications for E Biz

mstralka

#5
JUpload is commercial, but free for private or educational use...
I got JUpload to work with CPG.  This should make uploading much easier for users, provided they have Java and can use applets.

EDIT 8/27 - SEE NEW VERSION BELOW
GO IRISH

Joachim Müller

could you share your hack, e.g. post your modifications in detail? Thanks.

GauGau

mstralka

#7
EDIT 8/27/04: See new version below
GO IRISH

mstralka

#8
EDIT: See new version
GO IRISH

Joachim Müller

Quote from: mstralka on July 27, 2004, 12:48:47 AM
##Modified files:
upload.php - moved functions to upload_functions.php - added code to display JUpload applet if user has permission
groupmgr.php - groups need to have permission to use JUPLOAD - added permission field 'can_use_jupload'
includes/functions.inc.php - modified authentication to work with JUpload - pass cookies as GET parameter because I couldn't get JUpload cookie parameter to work lang/english.php - added a few labels
That's the important bit you should be more specific about if this mod is suppossed to be usefull for anyone. Usually, you give detailed instructions like
Quoteedit file xxx.php, findfooand replace withbar. Then findwhateverand add after itsomething

GauGau

mstralka

#10
EDIT 8/27/04: See new version below
GO IRISH

psychozz

Found one error:

You should replace:

<tr>
       <td class="tableh1" colspan="2"><b><span class="statlink">{$lang_groupmgr_php['group_name']}</span></b></td>
       <td class="tableh1"><b><span class="statlink">{$lang_groupmgr_php['disk_quota']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['can_rate']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['can_send_ecards']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['can_post_com']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['can_upload']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['approval_1']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['can_have_gallery']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['approval_2']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['upload_form_config']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['custom_user_upload']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['num_file_upload']}</span></b></td>
<td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['num_URI_upload']}</span></b></td>
</tr>


With:
<tr>
       <td class="tableh1" colspan="2"><b><span class="statlink">{$lang_groupmgr_php['group_name']}</span></b></td>
       <td class="tableh1"><b><span class="statlink">{$lang_groupmgr_php['disk_quota']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['can_rate']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['can_send_ecards']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['can_post_com']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['can_upload']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['approval_1']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['can_have_gallery']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['approval_2']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['can_use_jupload']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['upload_form_config']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['custom_user_upload']}</span></b></td>
       <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['num_file_upload']}</span></b></td>
 <td class="tableh1" align="center"><b><span class="statlink">{$lang_groupmgr_php['num_URI_upload']}</span></b></td>
</tr>



Otherwise it seems to work fine, but I still want to be able to upload more than 20 pictures at a time. I upload around 100 pictures each time so a hack that fixes zip upload would be very nice!

mstralka

Quote from: psychozz on August 08, 2004, 09:48:49 PM
I still want to be able to upload more than 20 pictures at a time. I upload around 100 pictures each time so a hack that fixes zip upload would be very nice!

20 is a practical limit, but you can change this by editing upload_functions.php.  I've uploaded 40 at a time.
In function jupload_applet():
FIND:
<!-- Maximums page 37-->
<param name="maxNumberFiles" value="20">
<param name="maxNumberFilesWarning" value="You can only upload 20 photos at a time.">
<param name="maxNumberFilesTitle" value="Upload limit">


Change that number to whatever you want, or get rid of those parameters completely.  Read the JUpload documentation for more info on what each parameter does.
GO IRISH

RatKing

I know this might be a little silly question but what version of Jupload did you use, I have been messign about with this and it simply doesn't seem to send any parameters to jupload.php other than:
  • control
  • unique_id
  • cookie

Other than that it seems to work quite well, execpt for the time estimation when uploading files but that might be because my connection her at work is slightly faster than the norm.  ;D

mstralka

Quote from: RatKing on August 20, 2004, 09:21:25 PM
I know this might be a little silly question but what version of Jupload did you use, I have been messign about with this and it simply doesn't seem to send any parameters to jupload.php other than:
  • control
  • unique_id
  • cookie
It also sends file_upload_request=1.

What else would you like it to send?  Those 4 variables are all it needs to process the photos.
GO IRISH

mstralka

#15

This MOD was updated on 9/23/04 to work with CPG 1.3.2.  Please use JUpload 0.75 - the newer versions seem to have some problems (thanks to Lapino for catching this)

Changes:
Removed jupload.php - integrated all JUpload functionality into upload.php and wrote step-by-step instructions
After uploading multiple photos, you can now edit all of their descriptions at once, instead of editing one, clicking next, editing another, and so on.  (I will make this feature available as a separate MOD for those who don't want to use JUpload.)

The instructions were too long to post so please download the attachment
GO IRISH

YUKAHO89

Can any on upload a origanal gallery comined with jupload ?
PLease

mstralka

Quote from: YUKAHO89 on September 12, 2004, 11:41:07 AM
Can any on upload a origanal gallery comined with jupload ?
PLease


I'm not sure what you mean.  Do you want to see an example?  It's used on my site everyday.
http://www.photo-junky.com
Sign in with email: cc@stralka.com
password: tester
GO IRISH

YUKAHO89

I dun know where to add this function and
after i have add the code in the php
the upload page comes blank
so i mean that can you upload a origanal gallery's
files  with the jupload


this function

function jupload_applet() {
//create the jupload applet
$unique_ID = substr(md5(microtime().getmypid()), 0, 8);
global $HTTP_COOKIE_VARS, $CONFIG;
global $lang_upload_php;
//convert the cookies into a string to append to the query string
//I could not get the browserCookie parameter to work properly with CPG so I pass it as a GET parameter.
//Not the best way to do it.
$cookieEnc = base64_encode(serialize($HTTP_COOKIE_VARS));
starttable("100%", $lang_upload_php['jupload_title'], 2);
echo <<<EOT
<tr>
<td colspan="2">
{$lang_upload_php['jupload_instr_1']}
</td>
</tr>
<tr>
<td colspan="2">
<applet
  code="JUpload/startup.class"
  archive="jupload.jar"
  width="500"
  height="300"
  mayscript="mayscript"
  name="JUpload"
  alt="JUpload applet">
<!-- From Page 30 upward -->
<!-- Java Plug-In Options -->
<param name="progressbar" value="true">
<param name="boxmessage" value="Loading JUpload Applet ...">
<param name="boxbgcolor" value="#e0e0ff">

<!-- Position & Size Page 38-->
<param name="mainSplitpaneLocation" value="300">
<!--Position the lower-left message window from the top-->
<param name="leftSplitpaneLocation" value="150">

<!-- Target links -->
<param name="actionURL" value="upload.php?control=phase_1&file_upload_request=1&unique_ID=$unique_ID&cookie=$cookieEnc">
<param name="completeURL" value="upload.php?control=phase_2&unique_ID=$unique_ID&cookie=$cookieEnc">

<!-- CUSTOMIZATIONS FOR COPPERMINE -->
<param name="tagName" value="file_upload_array">


<!-- Filters -->
<param name="imageFileFilter" value="true">
<param name="hideShowAll" value="true">

<!-- Messages -->
<param name="showSuccessDialog" value="false">
<param name="successDialogMessage" value="Photos uploaded successfully">
<param name="successDialogTitle" value="Upload Successful">

<!-- Maximums page 37-->
<param name="maxNumberFiles" value="999">
<param name="maxNumberFilesWarning" value="You can only upload 999 photos at a time.">
<param name="maxNumberFilesTitle" value="Upload limit">


<!-- Server -->
<!-- These all need to be false for the redirect to completeURL to work properly -->
<param name="showServerResponse" value="false">
<param name="checkResponse" value="false">
<param name="realTimeResponse" value="false">

<!-- Colors -->
<!-- This could easily be customized to match the theme in use-->
<param name="backgroundColor" value="#e0e0ff">

<!-- Switches -->
<param name="showStatusPanel" value="true">

<!--Recursion -->
<param name="useRecursivePaths" value="false">

<!-- Thumbnails -->
<param name="showThumbnails" value="false">

<!-- IF YOU HAVE PROBLEMS, CHANGE THIS TO TRUE BEFORE CONTACTING SUPPORT -->
<param name="debug" value="false">

Your browser does not support applets. Or you have disabled applet in your options.
To use this applet, please install the newest version of Sun's java. You can get it from <a href="http://www.java.com/">java.com</a>

</applet>
</td>
</tr>

EOT;
endtable();
}


mstralka

That function goes anywhere in upload.php, probably near the other functions.

Did you read the instructions completely?

## Author Notes: Download and install jupload from [url]http://jupload.biz[/url]
## Put JUpload.jar in the same directory as your coppermmine files or modify
## function jupload_applet() to point to it
## I recommend you install my Multiple Edit mod first:
## [url]http://forum.coppermine-gallery.net/index.php?topic=9391.new;[/url]


Have you followed the instructions and gone to http://jupload.biz and installed the Java applet file on your web server?
Legally, I cannot distribute that piece so you will have to get it yourself.

I've attached my upload.php (renamed it to upload.txt).  I think I have other modifications on it so I'm not sure if it will work for you

Hope that helps
Mark
GO IRISH