1
antifmradio
xoops renaming uploads

ok so everyone knows that when you upload or attach an image to a message in CBB (any version )
the system automatically renames the file online to whatever mishmash of numbers + the extension of the file.

Question is.... how can i stop it from doing this?

its taking a file for example named BOOKA-SHADE.jpg remixes
and naming it into
1_481d26517d8a3.jpg

sometimes i need to go into my uploads/newbb folder and find something but i cant tell which file it is if its just called
NUMBER_NUMBERS.jpg

2
antifmradio
Re: xoops renaming uploads

also
how do i change the size of the thumbnail settings?
Id like thumbs to be at a larger size when displayed but dont know where to find that

3
Anonymous
Re: xoops renaming uploads
  • 2008/5/18 21:21

  • Anonymous

  • Posts: 0

  • Since:


Quote:
antifmradio wrote:

Question is.... how can i stop it from doing this?


You can't. Sorry. End of.

4
Anonymous
Re: xoops renaming uploads
  • 2008/5/18 21:22

  • Anonymous

  • Posts: 0

  • Since:


Quote:
antifmradio wrote:

how do i change the size of the thumbnail settings?
Id like thumbs to be at a larger size when displayed but dont know where to find that


Try in the Module's preferences - there's an image-size setting in there.

5
xgarb
Re: xoops renaming uploads
  • 2008/6/8 15:34

  • xgarb

  • Not too shy to talk

  • Posts: 154

  • Since: 2003/3/30


you can change the filenames XOOPS saves images with.

See class/uploader.php for options here...

if (isset($this->targetFileName)) {
            
$this->savedFileName $this->targetFileName;
        } elseif (isset(
$this->prefix)) {
            
$this->savedFileName uniqid($this->prefix).'.'.strtolower($matched[1]);
        } else {
            
$this->savedFileName strtolower($this->mediaName);
        }


use it something like this...

$uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('image/gif''image/jpeg''image/pjpeg''image/x-png''image/png'), $imgcat->getVar('imgcat_maxsize'), $imgcat->getVar('imgcat_maxwidth'), $imgcat->getVar('imgcat_maxheight'));
    
$uploadedFilename $_FILES['image_file']['name'];
    
$uploader->setTargetFileName('myprefix_'.$uploadedFilename);    
    if (
$uploader->fetchMedia($xoops_upload_file[0])) {
        if (!
$uploader->upload()) {
            
$err $uploader->getErrors();


but you really should introduce a random element somewhere as well in case someone finds a way to upload a unsafe file.. makes it harder for them to find it on the server. I think the current system is there to prevent users over-writing each others files so you may want to keep that in mind as well.

Login

Who's Online

231 user(s) are online (154 user(s) are browsing Support Forums)


Members: 0


Guests: 231


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits