Accessing images via app problem
The goal I have is to have cPanel allow for an android app to access images from cPanel for use in the app. Issue is that whenever I add sometime to file manager I can never get a link to show on another computer, I even tried the public html folder.
I do not need anything fancy or complicated, I just need the ability for my android app source code to access images in cPanel via a basic JSON. I started with cloudinary website and it was successful but I was limited regarding bandwidth so I purchased a domain and hosting with go daddy.
-
Hi @beefcake2233 What did you mean when you said that you cannot get a link of image? can you navigate to the link through a browser (outside of your app)? While the file permission is 0644 you can get and access it from anywhere. 0 -
Hi @beefcake2233 What did you mean when you said that you cannot get a link of image? can you navigate to the link through a browser (outside of your app)? While the file permission is 0644 you can get and access it from anywhere.
So I am in my cpanel, and I have placed some samples images in the public_html folder for view, but when I go to example.com/imagefolder/image.jpg nothing shows up. Am I missing something that is SQL or PHP related? Goal is to be able to call on images from an android app via json. I have everything else working besides being able to get photos out of this website / cpanel.0 -
Am I missing something that is SQL or PHP related?
I think no, while everything else working correctly with the image link, maybe your json cannot make a connection with your website? Try some other ways to catch the error, e.g. 1- change the link in Json to another image link on another website 2- or try to use {try, catch} in your json to know if there's an error, something like that: This is of course out of cPanel at alltry { HttpURLConnection connection = (HttpURLConnection) imageURL .openConnection(); connection.connect(); // your script } catch (IOException e) { e.printStackTrace(); }
3- or try to change your mobile IP or navigate through a VPN to the image link through your mobile browser to ensure that it can get connected to your website.0 -
I think no, while everything else working correctly with the image link, maybe your json cannot make a connection with your website? Try some other ways to catch the error, e.g. 1- change the link in Json to another image link on another website 2- or try to use {try, catch} in your json to know if there's an error, something like that: This is of course out of cPanel at all
try { HttpURLConnection connection = (HttpURLConnection) imageURL .openConnection(); connection.connect(); // your script } catch (IOException e) { e.printStackTrace(); }
3- or try to change your mobile IP or navigate through a VPN to the image link through your mobile browser to ensure that it can get connected to your website.
I can open a private browser window and am not able to see anything I post in the root / public_html and the code is 0644. Can I PM you anything on this because I have to be missing something minor.0 -
Can I PM you anything on this because I have to be missing something minor.
You should never send details of your account to anyone you don't know. As your account lists you as a Website Owner, I suggest you contact your Hosting Provider, instead, and ask them to check your files and directories permissions.0 -
Hi @beefcake2233, I confirm what @Infopro said. As in everything else, also in programming we have first to analyse the problem before finding the solution. The expected reason for your issue (for my mind) is one or more of these: 1- Something in your website cPanel 2- Wrong script/s in your json 3- The capability of your mobile to connect to your website If you try the three steps that I've suggested before (do one step only for each try), or contact your host provider as Infopro said so, you can catch the reason. Try some other ways to catch the error, e.g. 1- change the link in Json to another image link on another website 2- or try to use {try, catch} in your json to know if there's an error, something like that: 3- or try to change your mobile IP or navigate through a VPN to the image link through your mobile browser to ensure that it can get connected to your website. I hope to help you Good luck 0
Please sign in to leave a comment.
Comments
6 comments