Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

file upload without file selected throws an exception #60

Merged
merged 1 commit into from
Jun 24, 2015

Conversation

weierophinney
Copy link
Member

Hi,
I found the UploadedFile class throws an exception,

InvalidArgumentException('Invalid stream or file provided for UploadedFile');

when no file is selected for upload.
This is indeed an error, with UPLOAD_ERR_NO_FILE. But I thought it would be nice if no exceptions are thrown at the creation of server request.

@weierophinney weierophinney added this to the 1.0.5 milestone Jun 24, 2015
@weierophinney weierophinney self-assigned this Jun 24, 2015
- Do not attempt to create a stream for the upload file if the error
  status is not `UPLOAD_ERR_OK`.
- If the error status is not `UPLOAD_ERR_OK`, raise a `RuntimeException`
  from each of `moveTo()` and `getStream()`.
@weierophinney
Copy link
Member

@asaokamei I've converted this issue to a pull request; please test!

@weierophinney weierophinney merged commit d24c2d1 into zendframework:master Jun 24, 2015
weierophinney added a commit that referenced this pull request Jun 24, 2015
weierophinney added a commit that referenced this pull request Jun 24, 2015
weierophinney added a commit that referenced this pull request Jun 24, 2015
@weierophinney weierophinney deleted the hotfix/60 branch June 24, 2015 14:52
@asaokamei
Copy link
Author

tested for, UPLOAD_ERR_OK, UPLOAD_ERR_FORM_SIZE, and UPLOAD_ERR_NO_FILE cases, and worked flawlessly!
thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants