New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HttpFoundation] InputFile constructor fails on Google app engine #9945
Comments
I think it's more a google app engine misunderstood than Symfony2 bug. Pretty similar situation occurs when you use AWS hosting, but it's covered by third party bundles. I feel the same in this place - this case should be resolved by creating new library for handling files from google engine. |
@piotrpasich I understand that this is caused by the differences between the google app engine platform and a normal php stack. its just that the condition placed by the constructor for the ini requirement causes requests with file uploads to fail with the exception yet the $_FILES array is well populated. This makes it harder for new people who would like to run the framework without modifying it on app engine. |
@marabooyankee as far as I know google engine allows to upload files only by specific API functions and they have disabled file_uploads option intentionally. You can find it in here: https://developers.google.com/appengine/docs/php/#PHP_Directives_with_new_initialization_defaults . Google recommends to use theirs functions to upload files. How to do that is described in here: https://developers.google.com/appengine/docs/php/googlestorage/#uploading_to_google_cloud_storage . Moreover, I haven't found any other possibility to check if you are able to upload files. In my opinion there should be created a new class to handle google storage. |
yes that is true the way it work is it generates a url that you use as the form action. after the upload through their infrastructure your script/endpoint gets invoked and they populate your $_FILES so you can proceed as if it was a normal file upload. |
@marabooyankee ok. So in my opinion there are two solutions:
|
Well the first method may not work since one can't override the file_uploads option this leaves us with option 2 which works but i'm not sure if it breaks anything as i can tell |
Well, the question that I have is why is the check there in the first place? If there is valid data in the files array, does it matter if the INI setting is off? Its not like this is in some replaceable component, but in the foundation bootstrapping. It is meant to represent the request... What are the downsides to removing the check? What issue is it there to guard against? From what I can tell, there is no known issue that it prevents, which is why removing it isn't "supporting a one off architecture" but simply simplifying an unnecessary check... My $0.02 at least... |
I wasn't able to find any issue with removing the check hence just On 22/03/2014, Anthony Ferrara notifications@github.com wrote:
David Wambugu |
#9784 has been merged now. |
The InputFile constructor https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/File/UploadedFile.php#L94
cause requests to fail when there are file uploads in the google app engine platform. This is primarily because the app engine platform uses their own Upload client and method visible here https://developers.google.com/appengine/docs/php/googlestorage/
which populates $_FILES superglobal while the php ini option for file_uploads option remains 0 hence causing an exception to be thrown.The file uploads option currently cannot be overridden on the platform.
I'm not currently aware of the best solution for it but commenting or removing that line allows file uploads to proceed.
The text was updated successfully, but these errors were encountered: