400 error when uploading file to the cloud, 404 error when deleting.

41 views
Skip to first unread message

Thomas Chatfield

unread,
Jan 26, 2014, 5:09:58 PM1/26/14
to codenameone...@googlegroups.com
final CloudStorage cloud = CloudStorage.getInstance();
                       
                        try{
                            id = cloud.uploadCloudFile("text/plain", path);
                        }catch(CloudException io)
                        {
                            io.printStackTrace();
                           Dialog.show("CloudException", "Could not upload workout to the cloud, please try again later.", "OK", null);
                        }catch(IOException i)
                        {
                            i.printStackTrace();
                            Dialog.show("IOException", "Could not upload workout to the cloud, please try again later.", "OK", null);
                        }finally{
                            loading.dispose();
                            FileSystemStorage.getInstance().delete(path);
                        }

I am uploading a file to the cloud storage using the above code , this works fine on the simulator but on my android tablet I am getting a 400 bad request error. 


I also get a 404 error when trying to delete a cloud file on the simulator. 

Thanks,

Tom

Shai Almog

unread,
Jan 27, 2014, 1:09:11 AM1/27/14
to codenameone...@googlegroups.com
Did you upgrade to pro?
The cloud storage support is a pro only feature:
http://codenameone.com/pricing.html

Thomas Chatfield

unread,
Jan 27, 2014, 2:54:31 AM1/27/14
to codenameone...@googlegroups.com
Thanks, I haven't upgraded to pro just yet still testing CloudStorage to make sure it is suitable for my needs.

I just assumed the free 2mb quota would work on the device too.

Shai Almog

unread,
Jan 27, 2014, 12:41:19 PM1/27/14
to codenameone...@googlegroups.com
I completely forgot about that quota, it should work if you are under quota. I looked at the server logs and I can't see a failure there so I'm not exactly sure.

Thomas Chatfield

unread,
Jan 27, 2014, 1:13:29 PM1/27/14
to codenameone...@googlegroups.com
So upgrading wouldn't necessarily fix the problem?

Like I said simulator works fine (apart from deleting) have uploaded and downloaded files many times. So maybe this is specific to Android? I don't have any other devices to test at the moment.

Shai Almog

unread,
Jan 27, 2014, 1:17:29 PM1/27/14
to codenameone...@googlegroups.com
I don't know but if you had a pro account we'd make sure the problem is fixed.
Since space is pretty constrained I'm guessing this exceeded quota.

Thomas Chatfield

unread,
Feb 15, 2014, 7:38:26 AM2/15/14
to codenameone...@googlegroups.com
Hey Shai,

I have now upgraded to pro and this problem persists. 

Trying to delete a cloud file in the simulator causes a 404 error. Uploading works on the simulator but not on my Android Tablet where I'm getting a 400 error.

Thanks.

Shai Almog

unread,
Feb 15, 2014, 12:15:00 PM2/15/14
to codenameone...@googlegroups.com
Hi Thomas,
can you send the code you used to get that error to the support email?

Thanks.
Reply all
Reply to author
Forward
0 new messages