menardmam
menardmam

Reputation: 9986

Rename uploaded file in joomla

I am new to Joomla, but i cannot seem to find a way to manually change the name of an uploaded file... please tell me how, if it is possible... i am a WordPress guy !

Do I have to install something more, because now, the only option I have is DELETE !

Upvotes: 0

Views: 3225

Answers (2)

Jobin
Jobin

Reputation: 8282

I know its an old post but it may help someone in future,

using joomla uploader just need to change like below.

    $file = JRequest::getVar('attachment', null, 'files', 'array');//attachment is the file type name in your html   
    jimport('joomla.filesystem.file');
    $filename = JFile::makeSafe($file['name']);
    $src = $file['tmp_name'];
    $dst = JPATH_SITE . DS . "images" . DS . 'archive'. DS. 'your_new_file_name'.JFile::getExt($filename);
     if ( JFile::upload($src, $dest) ){
       echo 'Uploaded';
     }
    else{
           echo 'Failed';
     }

Hope it helps someone..

Upvotes: 0

idea34
idea34

Reputation: 723

This capability is not supported in the built in media manager, but there are other options like jsmallfib

Upvotes: 1

Related Questions