Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 24. Oct 2017, 11:32

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Auto Rename files
PostPosted: 20. Jan 2014, 10:20 
Offline

Joined: 10. Jan 2014, 11:10
Posts: 7
Location: Hungary, 47.531169,21.600793
Hi,

Is there a way to rename the files automatically immediately before, or after upload? I would like to append a random number at the end of the file name.

Thanks, Róbert


Top
 Profile  
 
 Post subject: Re: Auto Rename files
PostPosted: 20. Jan 2014, 14:43 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10502
Sure. Use a plugin
check
http://www.tinywebgallery.com/en/tfu/web_plugin.php
prefix plugin. you can easily change this to add a random number.

Best, Michael


Top
 Profile  
 
 Post subject: Re: Auto Rename files
PostPosted: 21. Jan 2014, 10:03 
Offline

Joined: 10. Jan 2014, 11:10
Posts: 7
Location: Hungary, 47.531169,21.600793
It works perfectly!

I wrote this:
$prefix= rand(10000,99999);

$ext= pathinfo($filename, PATHINFO_EXTENSION);
$base= pathinfo($filename, PATHINFO_FILENAME);

$exchangefilename= dirname($fullpath). '/'. $base. '_'. $prefix. '.'. $ext;

Thanks, Michael!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO