Start a new topic

Uploading file with '@' in filename faild

Uploading files with '@' in filename, causes response error 403 from Google Cloud Store.

It looks like this is a limitation on the Google side- they don't allow the '@' character in their filename.
We're taking a look, but our library owner is out this week so it may be a bit of a delay, our apologies.
private void uploadPicture(File file) {

final FileMetaData metadata = new FileMetaData();

KinveyMetaData.AccessControlList acl = new KinveyMetaData.AccessControlList();

acl.setGloballyReadable(true);

metadata.setAcl(acl);

metadata.setFileName(file.getName());



kinveyClient.file().upload(metadata, file, new MetaUploadProgressListener() {



public void metaDataRetrieved(com.kinvey.java.model.FileMetaData meta) {

Log.i(TAG, "metaDataRetrieved " + meta.getId());

}



public void onSuccess(Void result) {

Log.i(TAG, "successfully upload file " + metadata.getId());

}



public void onFailure(Throwable error) {

Log.e(TAG, "failed to upload file.", error);

}



public void progressChanged(MediaHttpUploader uploader) throws IOException {

Log.i(TAG, "upload progress: " + uploader.getUploadState());

switch (uploader.getUploadState()) {

case INITIATION_STARTED:

Log.i(TAG, "Initiation Started");

break;

case INITIATION_COMPLETE:

Log.i(TAG, "Initiation Completed");

break;

case UPLOAD_IN_PROGRESS:

Log.i(TAG, "Upload percentage: " + uploader.getProgress());

break;

case UPLOAD_COMPLETE:

Log.i(TAG, "Upload Completed!");

break;

}

}

});

}







---------- LOG ------------



06-24 20:53:36.415 22426-22496/com.example.app D/HttpTransport﹕ -------------- REQUEST --------------

PUT http://storage.googleapis.com/20149fc741dd4f96ad0238576e6b16a0/9eeaaa6d-502c-4311-9ab0-7c9ccdaf0741/ktomek@gmail.com_extra_large.png?GoogleAccessId=558440376631@developer.gserviceaccount.com&Expires=1403636036&Signature=iLxhdhmHOOUNuiCKUpf6NG6XmtA4IueOudsrbwB1WHHbZPmXuORVsuFppt2jqThYtKbH5d/aUX9heq/3fJ4IBLoJUqdaIzMNwQAxWkoA4YTzlfRHweLjpbFtoQLcFJbxBdj7sfhPpiJPKHZhZil%2BG%2Bf7%2BtHbcIAlATYPkfDJDRE%3D

Accept-Encoding: gzip

Content-Range: bytes 0-37305/37306

Content-Type: application/octet-stream

Content-Length: 37306

06-24 20:53:36.416 22426-22496/com.example.app D/HttpTransport﹕ curl -v --compressed -X PUT -H 'Accept-Encoding: gzip' -H 'Content-Range: bytes 0-37305/37306' -H 'Content-Type: application/octet-stream' -d '@-' -- 'http://storage.googleapis.com/20149fc741dd4f96ad0238576e6b16a0/9eeaaa6d-502c-4311-9ab0-7c9ccdaf0741/ktomek@gmail.com_extra_large.png?GoogleAccessId=558440376631@developer.gserviceaccount.com&Expires=1403636036&Signature=iLxhdhmHOOUNuiCKUpf6NG6XmtA4IueOudsrbwB1WHHbZPmXuORVsuFppt2jqThYtKbH5d/aUX9heq/3fJ4IBLoJUqdaIzMNwQAxWkoA4YTzlfRHweLjpbFtoQLcFJbxBdj7sfhPpiJPKHZhZil%2BG%2Bf7%2BtHbcIAlATYPkfDJDRE%3D'
06-24 20:53:36.528 22426-22496/com.example.app D/HttpTransport﹕ Total: 37,306 bytes (logging first 16,384 bytes)

06-24 20:53:36.549 22426-22496/com.example.app D/HttpTransport﹕ ....

06-24 20:53:38.879 22426-22496/com.example.app D/HttpTransport﹕ -------------- RESPONSE --------------

403 Forbidden

Alternate-Protocol: 80:quic

Content-Length: 417

Content-Type: application/xml; charset=UTF-8

Date: Tue, 24 Jun 2014 18:53:29 GMT

Server: HTTP Upload Server Built on Jun 12 2014 14:56:53 (1402610213)

Vary: Origin

X-Android-Received-Millis: 1403636018871

X-Android-Sent-Millis: 1403636016526



Hm, can you PM me some sample data?
Still I get 403
Have you tried putting single quotes around it? That will make it appear as a string.
Login or Signup to post a comment