Error downloading file from backendless server || android


I am downloading an file from back-endless server using HttpURLConnection … and I get The file public URL by the user property “UserPhoto”… userphoto is the public URL for the photo of every user (in my app )

The code for getting the file is in AsyncTask class …
and I get IOException saying FileNotFoundException

That is the code for downloading the file :

URL photo_url = new URL(params[0]);
HttpURLConnection getPhoto =(HttpURLConnection)photo_url.openConnection();
InputStream photo = getPhoto.getInputStream();
user_photo = BitmapFactory.decodeStream(photo);

While “params” is an array containing the File public URL …
the file I am downloading is image … And Thanks

See the answer for this question on stackoverflow for an example:

Also, what value do you have in params[0] ?


“String” is a type. I am asking what specific value it has.

the url for the file : photo

That URL is wrong - try opening it in a browser. You will get this message:

{“code”:6007,“message”:“The specified resource was not found”}

oh that right … but why is this happening ? this is the public url for the file … I get it from backendless console !

Read this please:

I’ve read it … I am using the same method to get the public url from the backendless console

Can you attach a screenshot of Backendless console which shows the file in the directory? (I need to see the entire screen of the console)

ok please wait

that ?

Change the URL to put %20 where you have space:

I will try

That didn’t work …the same error is showing !!

Try the code from the stackoverflow article I posted earlier.

ok I will try

already solved it by adding “.png” in the file name while uploading it … thanks