Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Changing the filename in Meioupload

Featured Replies

0 down vote favorite

 

 

Hi,

 

I'm using Meioupload on a website built with CakePHP, and it is working fine for having multiple upload fields. The problem I have now is that if person A uploads a picture called 'me.jpg' and then person B uploads a picture called 'me.jpg', person B's will overwrite the first upload.

 

Is there a way in Meioupload to change the filename as the picture is uploaded? E.g. add the person's username to the start so it would look like 'persona_me.jpg' and 'personb_me.jpg'?

 

This is the code I currently have:

 

var $actsAs = array('MeioUpload' => array(
   'picture' => array(
       'dir' => 'files/device_images',
       'create_directory' => true,
       'allowed_mime' => array('image/jpeg', 'image/pjpeg', 'image/gif', 'image/png'),
       'allowed_ext' => array('.jpg', '.jpeg', '.png', '.gif'),
       'thumbsizes' => array(
              'small'  => array('width'=>100, 'height'=>100),
              'medium' => array('width'=>240, 'height'=>180),
              'large'  => array('width'=>640, 'height'=>480)
   )));

 

Thanks for any help

could use a database to get the next unique number to add on the end of an uploaded image so that even if the same user uploads an image called me.jpg but its a different one then they dont get rid of their old me.jpg that they may want.

 

where is the part of the script that names the images or carries the name through of the original image to save onto the server? other than that, like the above said you could use a timestamp, you could make the variable to change the name something like

 

$imagename = "'$originalname'.'time()'.'$extension'";

 

something similar to that should do the job

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.