[TIMOB-17253] iOS: Filename of a photo blob uploaded to ACS has no file extension and always has the same name
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-07-07T17:59:46.000+0000 |
Affected Version/s | Release 3.3.0 |
Fix Version/s | Release 3.3.0, Release 3.4.0 |
Components | Cloud, iOS |
Labels | module_acs, qe-3.3.0, qe-testadded, regression |
Reporter | Satyam Sekhri |
Assignee | Pedro Enrique |
Created | 2014-07-01T09:42:07.000+0000 |
Updated | 2014-07-07T18:58:30.000+0000 |
Description
When a image blob from a camera or gallery is uploaded on the ACS, it always has the same filename as "file0." and also the file extension is missing.
The issue is a regression and it did not occur on 3.2.3.GA.
Also the issue does not occur on Android. On iOS, if the photo to be uploaded is assigned through an image file instead of a blob from camera or gallery then it works fine.
Steps to Reproduce:
1. Create a default titanium classic app
2. Copy the app.js and windows folder from "~/Library/Application Support/Titanium/modules/commonjs/ti.cloud/3.2.3/example" into the Resources directory of the project.
3. Install and launch app on iOS device
4. Create a user from Users > Create User
5. Press back button twice and go to Photos > Create Photo
6. Press "Select Photo from Gallery" or "Take Photo with Camera" to select/take a photo and use it
7. Press Create button. The photo gets uploaded to the cloud and "Uploaded" alert is shown
8. Next go to Dashboard and check the photos object saved in the cloud for your project
Actual Result:
The photo object is created with filename "file0.". Every new photo from camera or gallery that is uploaded to the cloud has the same filename. And also it does not have a file extension.
If in the project file at "Resources > Windows > Photos > create.js", the line 147
photo: photo,
is replaced with
photo: Titanium.Filesystem.getFile('photo.jpg')
i.e. we assign the photo parameter of the photo create with a file instead of the blob from Camera or Gallery, then the issue does not occur and the new photo object in cloud is saved with the filename "photo.jpg"
PR for master: https://github.com/appcelerator/titanium_mobile/pull/5885 PR for 3.3.x: https://github.com/appcelerator/titanium_mobile/pull/5886 Sample code:
Verified fixed on: Mac OSX 10.9.4 Appcelerator Studio, build: 3.3.0.201407031747 Titanium SDK, build: 3.3.0.v20140707105712 Titanium CLI, build: 3.3.0-rc4 Alloy: 1.4.0-rc4 iOS Device: iPhone 5 (7.0.6) Followed test steps provided in the description as well as test code provided by [~penrique]. Photo is successfully uploaded to Dashboard with the correct file extension. Closing.