Page 1 of 2

Rename images additionalfilterid jimagefilter

Posted: Tue Jul 14, 2009 11:42 pm
by Gonzalo
I have tried to use the code that you
Second, you need to declare the two filters in applet javascript file:

Code: Select all

...
  <PARAM NAME="resources" VALUE="i18n">
  <PARAM NAME="additionalfilterid" VALUE="medium,small">
  <PARAM NAME="mediumfilter" VALUE="jfileupload.upload.client.filter.ImageFilter">
  <PARAM NAME="mediumfilterproperties" VALUE="scaling_medium.properties">
  <PARAM NAME="smallfilter" VALUE="jfileupload.upload.client.filter.ImageFilter">
  <PARAM NAME="smallfilterproperties" VALUE="scaling_small.properties">

Finally, you need to setup a custom rename policy to avoid file overwrite:
  <PARAM NAME="mediumfilterparam2" VALUE="renamepolicy">
  <PARAM NAME="mediumfiltervalue2" VALUE="custom">
  <PARAM NAME="mediumfilterparam3" VALUE="id">
  <PARAM NAME="mediumfiltervalue3" VALUE="thumb_640_480_">
  <PARAM NAME="smallfilterparam2" VALUE="renamepolicy">
  <PARAM NAME="smallfiltervalue2" VALUE="custom">
  <PARAM NAME="smallfilterparam3" VALUE="id">
  <PARAM NAME="smallfiltervalue3" VALUE="thumb_160_120_">
but I found a problem, do not like putting the name of each image I want.

Re: Rename images additionalfilterid jimagefilter

Posted: Wed Jul 15, 2009 7:09 pm
by support
Please find (attached below) a working sample of JFileUpload + JImageFilter 2.4. It includes ready to use sample for both HTTP and FTP upload. They generate and upload two images according to the tutorial. Open applet_ftp_scaling.html or applet_http_scaling.html to test it. You also need to update the JavaScript according to your server settings.
JFileUpload_JImageFilter_2.4_two_thumbnails.zip
JFileUpload + JImageFilter 2.4
(705.66 KiB) Downloaded 1651 times

Re: Rename images additionalfilterid jimagefilter

Posted: Thu Jul 16, 2009 12:48 pm
by Gonzalo
You can rename the images uploaded to a name that does not contain the original name?

Re: Rename images additionalfilterid jimagefilter

Posted: Thu Jul 16, 2009 7:34 pm
by support
Could you provide a sample of scaled image name you want if you upload image1.jpg and image2.jpg?

Re: Rename images additionalfilterid jimagefilter

Posted: Fri Jul 17, 2009 12:11 pm
by Gonzalo
that's exactly what I need.
thanks

Re: Rename images additionalfilterid jimagefilter

Posted: Fri Jul 17, 2009 4:54 pm
by support
Add the following parameter in the JavaScript:
<PARAM NAME="template" VALUE="image:timestamp::extension:">

and image uploaded will look like:
image1247849384642.jpeg
image1247849384815.jpeg
image1247849387175.jpeg
image1247849389356.jpeg
...

template parameter allows renaming filename on upload. Documentation is available at:
http://www.jfileupload.com/products/jfi ... n_ftp.html

Could it fit to your need?

Re: Rename images additionalfilterid jimagefilter

Posted: Fri Jul 17, 2009 5:12 pm
by Gonzalo
what I need is that the parameters of medium;
PARAM NAME = "mediumfilterparam3" VALUE = "id" to give it a name '< "ID">. Jpg'
parameters and small;
PARAM NAME = "smallfilterparam3" VALUE = "id" power to name 'small_< "ID">. Jpg'
< "ID"> is a name taken from the index table
can be done with jimagefilter?
excuse my spelling, but I would not write in English and use the translator google

Re: Rename images additionalfilterid jimagefilter

Posted: Sun Jul 26, 2009 3:58 pm
by support
We've just added auto increment identifier support in renaming template for release 2.5.
"identifierinit" parameter allows selecting starting identifier:
<PARAM NAME="template" VALUE="myfile_:identifier::extension:">
<PARAM NAME="identifierinit" VALUE="1">

Then uploaded files will be renamed as:
myfile_1.jpg
myfile_2.jpg
myfile_3.jpg
...

I will drop you an email with the 2.5 Beta.

Re: Rename images additionalfilterid jimagefilter

Posted: Fri Jul 31, 2009 11:42 pm
by Gonzalo
I'm trying to update and save file with me a number followed by the extension "1249083271967" and add the original file name;
name of the file to upload "image1"
I need to put the name "ID1"
name records after uploading the file:
"image1.jpg.132345678794"

I use the code:

Code: Select all

document.writeln('<PARAM NAME="template" VALUE="id1:identifier::extension:">')
document.writeln('<PARAM NAME="identifierinit" VALUE="1">')	
document.writeln('<PARAM NAME="additionalfilterid" VALUE="medium,small">');
document.writeln('<PARAM NAME="mediumfilter" VALUE="jfileupload.upload.client.filter.ImageFilter">');
document.writeln('<PARAM NAME="mediumfilterproperties" VALUE="scaling_medium.properties">');
document.writeln('<PARAM NAME="smallfilter" VALUE="jfileupload.upload.client.filter.ImageFilter">');
document.writeln('<PARAM NAME="smallfilterproperties" VALUE="scaling_small.properties"> ');
document.writeln('<PARAM NAME="mediumfilterparam2" VALUE="renamepolicy">');
document.writeln('<PARAM NAME="mediumfiltervalue2" VALUE="custom">');
document.writeln('<PARAM NAME="mediumfilterparam3" VALUE="id">');
document.writeln('<PARAM NAME="mediumfiltervalue3" VALUE="medium_">');
document.writeln('<PARAM NAME="smallfilterparam2" VALUE="renamepolicy">');
document.writeln('<PARAM NAME="smallfiltervalue2" VALUE="custom">');
document.writeln('<PARAM NAME="smallfilterparam3" VALUE="id">');
document.writeln('<PARAM NAME="smallfiltervalue3" VALUE="small_">');

Re: Rename images additionalfilterid jimagefilter

Posted: Sun Aug 02, 2009 7:57 pm
by support
I've just made another test and it works fine.
Images uploaded are:
id11.jpeg
id12.jpeg
id13.jpeg
id14.jpeg
...

Could you try to clean your Java cache before testing:
Start->Control panel->Java->First tab->Delete temporary files->Apply

I enclose my JavaScript.
applet_http_scaling.zip
JavaScript with new template
(1.43 KiB) Downloaded 1654 times