- $upload = null;
-
- try {
- $upload = MediaFile::fromUpload('media', $this->auth_user);
- } catch (Exception $e) {
- $this->clientError($e->getMessage(), $e->getCode());
- return;
- }
+ // we could catch "NoUploadedMediaException" as "no media uploaded", but here we _always_ want an upload
+ $upload = MediaFile::fromUpload('media', $this->scoped);
+
+ // Thumbnails will be generated/cached on demand when accessed (such as with /attachment/:id/thumbnail)