Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8455793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:22:33+00:00 2026-06-10T12:22:33+00:00

I cannot load image from Zend server with following code: Console.WriteLine(> + url); Console.WriteLine(>

  • 0

I cannot load image from Zend server with following code:

Console.WriteLine(">" + url);
Console.WriteLine(">" + NSUrl.FromString(url));
Console.WriteLine(">" + NSData.FromUrl(NSUrl.FromString(url))); // Null on this line

It appears only when I’m trying to load image from my server, any other source works fine. Here is my Zend controller code:

public function getAction()
{
    $file_id = (int)$this->_getParam('id');
    $file = $this->fileModel->getById($file_id);

    $this->getResponse()
        ->setHttpResponseCode(200)
        ->setHeader('Pragma', 'public', true)
        ->setHeader('Expires', '', true)
        ->setHeader('Cache-Control', 'public', true)
        ->setHeader('Cache-Control', 'max-age=3800')
        ->setHeader('Content-type', $file->CONTENT_TYPE, true)
        ->setHeader('Content-Length', $file->FILE_SIZE)
        ->clearBody();
    $this->getResponse()->sendHeaders();

    echo base64_decode($file->FILEBODY);
    exit;
}

Image showed fine in browser. What’s wrong with my code?

PS: my server works throught HTTPS without any signed certificate

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:22:35+00:00Added an answer on June 10, 2026 at 12:22 pm

    NSData.FromUrl (dataWithContentsOfURL: in Objective-C) will return null for any error.

    From Apple documentation:

    Returns nil if the data object could not be created.

    So something went wrong…

    PS: my server works throught HTTPS without any signed certificate

    Doubtful. You likely have a self-signed certificate (or your server should not be happy). Anyway…

    If, when trying your URL, Safari (from your iPhone/iPad) warns you about your site then it falls into the something went wrong category and the null value you get is normal.

    You might want to try HTTP: to make sure it’s not related to something else (e.g. networking issues).

    Now if you *really want to use an untrusted SSL server you can use some .NET API, e.g. WebClient.

     var wc = new WebClient ();
     byte[] data = wc.DownloadData (url);
    

    That alone will get you an exception (untrusted SSL server) but IMO that’s already better than simply a null.

    Next you’ll need to vouch for the untrusted certificate. There’s a few different ways to do it (some much better than others). I fairly complete list of them (with source) code can be found in this article.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I cannot load the image from url and play into my listfield ImageLoader class
How do you load an image from a URL and then put it into
Based on feedback from URL to load resources from the classpath in Java i
USing UIImage, I know we can store an image from a URL. But I
I need to load an image from IsolatedStorage , and display it on an
It's possible to load an image from resources passing to R.drawable a String? I'm
Im trying to load an image from my webserver and display it as an
I'm just wondering why I cannot load a resource with the Thread context loader
I am using System.Reflection to load a type that I cannot otherwise load during
I tried to load top3 record of table into DataGrid it shows error Cannot

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.