Bug ID: 61705
           Summary: Extension code can't get stashed file's path from
           Product: MediaWiki
           Version: 1.23-git
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Uploading
       Web browser: ---
   Mobile Platform: ---

I have not completely deciphered the Upload classes, so I apologize if I

For the extension development I'm doing, I'm working with a specialized
subclass of SpecialUpload that sometimes interrupts the final stage of
uploading, and does other work with the file contents rather than publishing it
to a File: page.

When the file is uploaded directly, it seems I can find it using
$this->mUpload->getTempPath() and operate on the file contents, but if the file
has been stashed and mUpload is now an UploadFromStash object, that doesn't

The only way I can see to get the stashed file's path is to ignore mUpload, go
back to the session key from the request data, and use
UploadStash::getMetadata() to find out where the file is.  This requires me to
violate UploadBase's polymorphism and handle the separate cases in my calling

Another option would be to call $this->mUpload->stashSession(), but if I'm not
mistaken that would actually copy the file to a second stashed location, which
is wasteful.

It would be helpful to have getTempPath() or a similar method give me the path
of the stashed file, so that my code would not have to know whether
$this->mUpload is stashed or not.

You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
Wikibugs-l mailing list

Reply via email to