blackberry-webworks / BB10-Webworks-API

An api repository for webworks
6 stars 1 forks source link

As a WebWorks developer, I can transfer files from the device to a remote server and vice-versa #26

Closed kwallis closed 11 years ago

kwallis commented 12 years ago

This API allows a developer to transfer file content to and from the device from remote servers. I.e. both upload and download. This will leverage HTTP and HTTPS multi-part POST and GET.

Acceptance Criteria

  1. Overall strategy is to use the Cordova FileTransfer API signature.
  2. Use the "blackberry.io.filetransfer" namespace and feature id.
  3. Support both HTTP and HTTPS protocols
  4. Ability to upload a file from the local file system to a remote server
  5. Able to specify the mime type of the content to be uploaded
  6. Ability to download remote content to a file on the local file system
  7. Error handling provided for failed uploads or downloads
  8. HTTP response code and content should be accessible on uploads
rwmtse commented 11 years ago

@kwallis Just to double-check, is the feature id "blackberry.io" or "blackberry.io.filetransfer"?

kwallis commented 11 years ago

Blackberry.io.filetransfer

----- Original Message ----- From: Rosa Tse [mailto:reply@reply.github.com] Sent: Tuesday, May 29, 2012 03:50 PM To: Ken Wallis Subject: Re: [BB10-Webworks-API] As a WebWorks developer, I can transfer files from the device to a remote server and vice-versa (#26)

@kwallis Just to double-check, is the feature id "blackberry.io" or "blackberry.io.filetransfer"?


Reply to this email directly or view it on GitHub: https://github.com/blackberry-webworks/BB10-Webworks-API/issues/26#issuecomment-5993855


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

nukulb commented 11 years ago

@kwallis - what should the chunk size be? Should it be configurable? Cordova simply defines true or false for chunking.

If true is selected there should be default chunk size. Do you care to make it configurable?

adrianlee commented 11 years ago

@nukulb @kwallis

If we download a file and specify the target to be a directory that does not exist on the device. Should we create that directory?

Let's say /accounts/1000/shared/camera/somedir/ where /somedir/ does not exist.

kwallis commented 11 years ago

Let's do that. Please ensure that we handle the case where we can't create the required directory. We should also test what happens if we try to create a dir in different perimeters and what that means.

Ken Wallis

Product Manager – BlackBerry WebWorks

Research In Motion

(905) 629-4746 x14369


From: Adrian Lee [reply@reply.github.com] Sent: Tuesday, June 12, 2012 6:29 PM To: Ken Wallis Subject: Re: [BB10-Webworks-API] As a WebWorks developer, I can transfer files from the device to a remote server and vice-versa (#26)

@nukulb @kwallis

If we download a file and specify the target to be a directory that does not exist on the device. Should we create that directory?

Let's say /accounts/1000/shared/camera/somedir/ where /somedir/ does not exist.


Reply to this email directly or view it on GitHub: https://github.com/blackberry-webworks/BB10-Webworks-API/issues/26#issuecomment-6285885


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

adrianlee commented 11 years ago

When creating a target directory, we can encounter the following problem:

The current FileTransferError codes are :

I'd like to propose two more constants to make it more clear when an error is thrown:

kwallis commented 11 years ago

Looks good.

----- Original Message ----- From: Adrian Lee [mailto:reply@reply.github.com] Sent: Friday, June 15, 2012 05:58 PM To: Ken Wallis Subject: Re: [BB10-Webworks-API] As a WebWorks developer, I can transfer files from the device to a remote server and vice-versa (#26)

When creating a target directory, we can encounter two problems:

The current FileTransferError codes are :

I'd like to propose two more constants to make it more clear when an error is thrown:


Reply to this email directly or view it on GitHub: https://github.com/blackberry-webworks/BB10-Webworks-API/issues/26#issuecomment-6367611


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

kwallis commented 11 years ago

What are the Cordova chuck sizes?

At the last demo, we sort of punted and left them at 1MB. Ideally this could be configurable, but if we are looking at significant delays then we can defer that to next release.

----- Original Message ----- From: Nukul Bhasin [mailto:reply@reply.github.com] Sent: Friday, June 01, 2012 03:37 PM To: Ken Wallis Subject: Re: [BB10-Webworks-API] As a WebWorks developer, I can transfer files from the device to a remote server and vice-versa (#26)

@kwallis - what should the chunk size be? Should it be configurable? Cordova simply defines true or false for chunking.

If true is selected there should be default chunk size. Do you care to make it configurable?


Reply to this email directly or view it on GitHub: https://github.com/blackberry-webworks/BB10-Webworks-API/issues/26#issuecomment-6069027


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

adrianlee commented 11 years ago

@kwallis I edited my last message. Can you reconfirm you are okay with it?

kwallis commented 11 years ago

If it is really related to a permissions issue, invalid target I don't think is accurate enough. If permissions, then can we say something like PERMISSIONS_ERR?

----- Original Message ----- From: Adrian Lee [mailto:reply@reply.github.com] Sent: Friday, June 15, 2012 06:36 PM To: Ken Wallis Subject: Re: [BB10-Webworks-API] As a WebWorks developer, I can transfer files from the device to a remote server and vice-versa (#26)

@kwallis I edited my last message. Can you reconfirm you are okay with it?


Reply to this email directly or view it on GitHub: https://github.com/blackberry-webworks/BB10-Webworks-API/issues/26#issuecomment-6368227


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

adrianlee commented 11 years ago

Cordova sets it to their chunk buffer size to 1MB for the Andriod. chunkedMode is not supported for iOS. I will add a chunk size parameter to the FileUploadOptions object. Should we call it chunkSize or chunkedSize?

Permission error makes more sense, I will make sure there is a description for this error in the docs for it. PERMISSION_ERR or PERMISSIONS_ERR?

kwallis commented 11 years ago

Chunksize

Permissions_err

----- Original Message ----- From: Adrian Lee [mailto:reply@reply.github.com] Sent: Friday, June 15, 2012 06:54 PM To: Ken Wallis Subject: Re: [BB10-Webworks-API] As a WebWorks developer, I can transfer files from the device to a remote server and vice-versa (#26)

Cordova sets it to their chunk buffer size to 1MB for the Andriod. chunkedMode is not supported for iOS. I will add a chunk size parameter to the FileUploadOptions object. Should we call it chunkSize or chunkedSize?

Permission error makes more sense, I will make sure there is a description for this error in the docs for it. PERMISSION_ERR or PERMISSIONS_ERR?


Reply to this email directly or view it on GitHub: https://github.com/blackberry-webworks/BB10-Webworks-API/issues/26#issuecomment-6368501


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

ericpearson commented 11 years ago

It doesn't look like the current API implementation respects the whitelist permissions when uploading. This should be fixed.

nukulb commented 11 years ago

@kwallis whitelist issue - I assume we want this.

kwallis commented 11 years ago

Yes, we want to respect whitelist.