https://bugzilla.wikimedia.org/show_bug.cgi?id=61705

            Bug ID: 61705
           Summary: Extension code can't get stashed file's path from
                    UploadFromStash
           Product: MediaWiki
           Version: 1.23-git
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Uploading
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: worden....@gmail.com
                CC: aarcos.w...@gmail.com, bawolff...@gmail.com,
                    bryan.tongm...@gmail.com, fflo...@wikimedia.org,
                    gti...@wikimedia.org, mtrac...@member.fsf.org
       Web browser: ---
   Mobile Platform: ---

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

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
work.

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
code.

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
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to