Describe the bug or issue you're experiencing
I cannot upload any files to my file upload field, it results in a 500 error in the console which means the file is not saved to the form & not uploaded to my user uploads directory. The following is what is returned in the network 500 error.
{"message":"stream_copy_to_stream(): Argument #2 ($to) must be of type resource, bool given","exception":"TypeError","file":"/Users/john/mysite/vendor/craftcms/cms/src/fs/Local.php","line":222,"trace":[{"file":"/Users/john/mysite/vendor/craftcms/cms/src/fs/Local.php","line":222,"function":"stream_copy_to_stream"},{"file":"/Users/john/mysite/vendor/craftcms/cms/src/elements/Asset.php","line":2651,"function":"writeFileFromStream","class":"craft\\fs\\Local","type":"->"},{"file":"/Users/john/mysite/vendor/craftcms/cms/src/elements/Asset.php","line":2382,"function":"_relocateFile","class":"craft\\elements\\Asset","type":"->"},{"file":"/Users/john/mysite/vendor/craftcms/cms/src/services/Elements.php","line":2695,"function":"afterSave","class":"craft\\elements\\Asset","type":"->"},{"file":"/Users/john/mysite/vendor/craftcms/cms/src/services/Elements.php","line":765,"function":"_saveElementInternal","class":"craft\\services\\Elements","type":"->"},{"file":"/Users/john/mysite/vendor/solspace/craft-freeform/packages/plugin/src/Services/FilesService.php","line":200,"function":"saveElement","class":"craft\\services\\Elements","type":"->"},{"file":"/Users/john/mysite/vendor/solspace/craft-freeform/packages/plugin/src/Controllers/FileUploadController.php","line":83,"function":"uploadDragAndDropFile","class":"Solspace\\Freeform\\Services\\FilesService","type":"->"},{"function":"actionPost","class":"Solspace\\Freeform\\Controllers\\FileUploadController","type":"->"},{"file":"/Users/john/mysite/vendor/yiisoft/yii2/base/InlineAction.php","line":57,"function":"call_user_func_array"},{"file":"/Users/john/mysite/vendor/yiisoft/yii2/base/Controller.php","line":178,"function":"runWithParams","class":"yii\\base\\InlineAction","type":"->"},{"file":"/Users/john/mysite/vendor/yiisoft/yii2/base/Module.php","line":552,"function":"runAction","class":"yii\\base\\Controller","type":"->"},{"file":"/Users/john/mysite/vendor/craftcms/cms/src/web/Application.php","line":301,"function":"runAction","class":"yii\\base\\Module","type":"->"},{"file":"/Users/john/mysite/vendor/yiisoft/yii2/web/Application.php","line":103,"function":"runAction","class":"craft\\web\\Application","type":"->"},{"file":"/Users/john/mysite/vendor/craftcms/cms/src/web/Application.php","line":286,"function":"handleRequest","class":"yii\\web\\Application","type":"->"},{"file":"/Users/john/mysite/vendor/yiisoft/yii2/base/Application.php","line":384,"function":"handleRequest","class":"craft\\web\\Application","type":"->"},{"file":"/Users/john/mysite/web/index.php","line":14,"function":"run","class":"yii\\base\\Application","type":"->"},{"file":"/Users/john/.composer/vendor/laravel/valet/server.php","line":234,"function":"require"}],"error":"stream_copy_to_stream(): Argument #2 ($to) must be of type resource, bool given"}
The following is my file upload field settings in Freeform
The following is the request URL when a file is uploaded
Steps to reproduce
Add a form with a file upload field
Attach a file and submit the form
Expected behavior
The file should attach and be saved to the assets
Craft & Plugin Info (please complete the following information):
Describe the bug or issue you're experiencing I cannot upload any files to my file upload field, it results in a 500 error in the console which means the file is not saved to the form & not uploaded to my user uploads directory. The following is what is returned in the network 500 error.
{"message":"stream_copy_to_stream(): Argument #2 ($to) must be of type resource, bool given","exception":"TypeError","file":"/Users/john/mysite/vendor/craftcms/cms/src/fs/Local.php","line":222,"trace":[{"file":"/Users/john/mysite/vendor/craftcms/cms/src/fs/Local.php","line":222,"function":"stream_copy_to_stream"},{"file":"/Users/john/mysite/vendor/craftcms/cms/src/elements/Asset.php","line":2651,"function":"writeFileFromStream","class":"craft\\fs\\Local","type":"->"},{"file":"/Users/john/mysite/vendor/craftcms/cms/src/elements/Asset.php","line":2382,"function":"_relocateFile","class":"craft\\elements\\Asset","type":"->"},{"file":"/Users/john/mysite/vendor/craftcms/cms/src/services/Elements.php","line":2695,"function":"afterSave","class":"craft\\elements\\Asset","type":"->"},{"file":"/Users/john/mysite/vendor/craftcms/cms/src/services/Elements.php","line":765,"function":"_saveElementInternal","class":"craft\\services\\Elements","type":"->"},{"file":"/Users/john/mysite/vendor/solspace/craft-freeform/packages/plugin/src/Services/FilesService.php","line":200,"function":"saveElement","class":"craft\\services\\Elements","type":"->"},{"file":"/Users/john/mysite/vendor/solspace/craft-freeform/packages/plugin/src/Controllers/FileUploadController.php","line":83,"function":"uploadDragAndDropFile","class":"Solspace\\Freeform\\Services\\FilesService","type":"->"},{"function":"actionPost","class":"Solspace\\Freeform\\Controllers\\FileUploadController","type":"->"},{"file":"/Users/john/mysite/vendor/yiisoft/yii2/base/InlineAction.php","line":57,"function":"call_user_func_array"},{"file":"/Users/john/mysite/vendor/yiisoft/yii2/base/Controller.php","line":178,"function":"runWithParams","class":"yii\\base\\InlineAction","type":"->"},{"file":"/Users/john/mysite/vendor/yiisoft/yii2/base/Module.php","line":552,"function":"runAction","class":"yii\\base\\Controller","type":"->"},{"file":"/Users/john/mysite/vendor/craftcms/cms/src/web/Application.php","line":301,"function":"runAction","class":"yii\\base\\Module","type":"->"},{"file":"/Users/john/mysite/vendor/yiisoft/yii2/web/Application.php","line":103,"function":"runAction","class":"craft\\web\\Application","type":"->"},{"file":"/Users/john/mysite/vendor/craftcms/cms/src/web/Application.php","line":286,"function":"handleRequest","class":"yii\\web\\Application","type":"->"},{"file":"/Users/john/mysite/vendor/yiisoft/yii2/base/Application.php","line":384,"function":"handleRequest","class":"craft\\web\\Application","type":"->"},{"file":"/Users/john/mysite/web/index.php","line":14,"function":"run","class":"yii\\base\\Application","type":"->"},{"file":"/Users/john/.composer/vendor/laravel/valet/server.php","line":234,"function":"require"}],"error":"stream_copy_to_stream(): Argument #2 ($to) must be of type resource, bool given"}
The following is my file upload field settings in Freeform
The following is the request URL when a file is uploaded
Steps to reproduce
Expected behavior The file should attach and be saved to the assets
Craft & Plugin Info (please complete the following information):