Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9170405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:00:53+00:00 2026-06-17T16:00:53+00:00

Magento stores image, by default, as ~/D/E/DEFAULT.jpg using the first two letters of the

  • 0

Magento stores image, by default, as

~/D/E/DEFAULT.jpg

using the first two letters of the filename to create the folder structure. I would like to have it work a different way, but can’t find anything about it on the admin backend, or through google searches. Has anyone had experience with this before?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:00:54+00:00Added an answer on June 17, 2026 at 4:00 pm

    What you are looking for seems to be handled in the class Varien_File_Uploader, so deep down in Magento in the lib/Varien folder.
    There is a method getDispretionPath($fileName) which looks like this:

    static public function getDispretionPath($fileName)
    {
        $char = 0; 
        $dispretionPath = '';
        while (($char < 2) && ($char < strlen($fileName))) {
            if (empty($dispretionPath)) {
                $dispretionPath = DIRECTORY_SEPARATOR
                    . ('.' == $fileName[$char] ? '_' : $fileName[$char]);
            } else {
                $dispretionPath = self::_addDirSeparator($dispretionPath)
                      . ('.' == $fileName[$char] ? '_' : $fileName[$char]);
            }
            $char ++;
        }
        return $dispretionPath;
    }
    

    Basically, the while loop has maximally two runs in which it adds a directory separator followed by a character (or “_” in case the character was a “.”) of the filename to the $dispretionPath and returns that path. This method is in turn used in the save() method of the same class which then creates the directories:

    $this->_dispretionPath = self::getDispretionPath($fileName);
    $destinationFile.= $this->_dispretionPath;
    $this->_createDestinationFolder($destinationFile);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a magento website with multiple stores. I would like to setup CMS
I would like to move the media directory in for my magento store to
I'm using Magento 1.5 with 3 different stores (same products, though targetted at different
Does anyone know if it's possible to create one of the stores with magento
I'm importing multiple products to Magento. I have two stores where I want to
I am using magento 1.5, I already created different stores in my store. I
I would like to set up a magento website to sell pizzas, here are
I've got two Magento stores and read that there is an important security problem
I have two stores in my Magento Site (English/Welsh). Is there a way of
Recently launched a Magento store which features an image slider on the homepage. Works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.