Extension: how to use PhabricatorFile::newFromFileData()
Extension: how to use PhabricatorFile::newFromFileData()
Event Timeline
Herald added subscribers: Cigaryno, Matthew. · View Herald TranscriptJun 11 2023, 10:052023-06-11 10:05:02 (UTC+0)
Comment Actions
I don't remember the details; It's possible that a CSRF token is created in the Form class ("PhabricatorForm"? "PhutilForm"?), and is only available in POST responses ($request->isFormPost()).
https://we.phorge.it/source/phorge/browse/master/src/applications/files/controller/PhabricatorFileUploadController.php is an example of a controller creating a file with no javascript code (the DopUpload controller needs cooperation from some javscript).
Comment Actions
This sounds indeed logical that it's only for POST calls.
I'll look into it further this week
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0