Giter VIP home page Giter VIP logo

Comments (6)

matteotestoni avatar matteotestoni commented on September 27, 2024

this is uploadfile of the extension

    /**
     * Upload and resize new file
     *
     * @param string $targetPath Target directory
     * @param string $type Type of storage, e.g. image, media etc.
     * @throws Mage_Core_Exception
     * @return array File info Array
     */
    public function uploadFile($targetPath, $type = null)
    {
        $uploader = new Mage_Core_Model_File_Uploader('image');
        if ($allowed = $this->getAllowedExtensions($type)) {
            $uploader->setAllowedExtensions($allowed);
        }
        $uploader->setAllowRenameFiles(true);
        $uploader->setFilesDispersion(false);
        $result = $uploader->save($targetPath);

        if (!$result) {
            Mage::throwException( Mage::helper('cms')->__('Cannot upload file.') );
        }

        // create thumbnail
        if ($this->getUploadType() == 'image') {
            $this->resizeFile($targetPath . DS . $uploader->getUploadedFileName(), true);
        }

        $result['cookie'] = array(
            'name'     => session_name(),
            'value'    => $this->getSession()->getSessionId(),
            'lifetime' => $this->getSession()->getCookieLifetime(),
            'path'     => $this->getSession()->getCookiePath(),
            'domain'   => $this->getSession()->getCookieDomain()
        );

        return $result;
    }

from magento-lts.

matteotestoni avatar matteotestoni commented on September 27, 2024

maybe getSession() to _getSession()?

from magento-lts.

kiatng avatar kiatng commented on September 27, 2024

maybe getSession() to _getSession()?

That would depends on the parent classes. But this should work:

      $session = Mage::getSingleton('core/session');
      $result['cookie'] = array(
            'name'     => session_name(),
            'value'    => $session->getSessionId(),
            'lifetime' => $session->getCookieLifetime(),
            'path'     => $session->getCookiePath(),
            'domain'   => $session->getCookieDomain()
        );

from magento-lts.

matteotestoni avatar matteotestoni commented on September 27, 2024

Not resolve because the problem is before.
NWD revolution slider extend Mage_Cms_Model_Wysiwyg_Images_Storage to create a custom uploader and maybe something is changed in session for 20.1.1
Maybe something in javascript

I think media storage can have a custom menu like media library of wordpress.

Maybe someone can resolve this problem with a paid work?

from magento-lts.

ADDISON74 avatar ADDISON74 commented on September 27, 2024

I have created a new category in Discussions for those interested in solving their problems quickly by paying a developer

https://github.com/OpenMage/magento-lts/discussions/categories/hire

from magento-lts.

matteotestoni avatar matteotestoni commented on September 27, 2024

submitted

from magento-lts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.