Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Accessing images via app problem

Discussion in 'General Discussion' started by beefcake2233, Oct 7, 2018.

  1. beefcake2233

    beefcake2233 Registered

    Joined:
    Oct 7, 2018
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Florica
    cPanel Access Level:
    Website Owner
    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.
     
  2. Shood

    Shood Well-Known Member

    Joined:
    Aug 12, 2015
    Messages:
    74
    Likes Received:
    14
    Trophy Points:
    83
    Location:
    Middle East
    cPanel Access Level:
    Root Administrator
    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.
     
    beefcake2233 likes this.
  3. beefcake2233

    beefcake2233 Registered

    Joined:
    Oct 7, 2018
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Florica
    cPanel Access Level:
    Website Owner

    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.
     
    #3 beefcake2233, Oct 8, 2018
    Last edited by a moderator: Oct 8, 2018
  4. Shood

    Shood Well-Known Member

    Joined:
    Aug 12, 2015
    Messages:
    74
    Likes Received:
    14
    Trophy Points:
    83
    Location:
    Middle East
    cPanel Access Level:
    Root Administrator
    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
    Code:
    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.
     
    beefcake2233 likes this.
  5. beefcake2233

    beefcake2233 Registered

    Joined:
    Oct 7, 2018
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Florica
    cPanel Access Level:
    Website Owner

    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.
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,880
    Likes Received:
    482
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Shood likes this.
  7. Shood

    Shood Well-Known Member

    Joined:
    Aug 12, 2015
    Messages:
    74
    Likes Received:
    14
    Trophy Points:
    83
    Location:
    Middle East
    cPanel Access Level:
    Root Administrator
    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
     
    #7 Shood, Oct 10, 2018
    Last edited by a moderator: Oct 10, 2018
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice