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 6626889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:56:52+00:00 2026-05-25T21:56:52+00:00

There is some .php file, that returns .png image file. How to get this

  • 0

There is some .php file, that returns .png image file.

How to get this image with jQuery $.ajax() ?

Also, is there were some mistakes with input parameters, .php file will return error in JSON way.

How to understand, which infomation was returned – image or JSON with error?

UPDATE:

I need to draw some statistics graphics with this script. .php file gets some data (for example account id, which statistics is requested) and checks – if this user (user id is got from session is allowed to view the requested user’s statistics, or not). If it’s allowed than image is returned, if not – than json error.
So i can make but if there will be error, image doesn’t load. But I need to show error notification to user.

  • 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-05-25T21:56:53+00:00Added an answer on May 25, 2026 at 9:56 pm

    You can use it like this:

    <img src="data:image/png;base64,R0lGODlhUA... " width="80" height="15" />
    

    So i suggest you get the base64 encoded string from the ajax request and use that to display the image

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

Sidebar

Related Questions

I heard that in PHP there are some alternatives for the functions substr() and
I have a form which has action=process.php . Inside that php file there is
I have some ajax code that executes on mouseclick. It calls a file called
I was browsing the template.php file for the rootcandy theme and noticed some of
Is there some equivalent of friend or internal in php? If not, is there
I develop some PHP project on Linux platform. Are there any disadvantages of putting
I am looking at some PHP code where there are translation strings. For French
I'm using PHP in order to redirect some search query. There is some example
We run a number of web applications written in PHP. Unfortunately there are some
I had made some questions regarding PHP-GTK (there are only 4 php-gtk tagged questions

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.