how to download the images in php?

12/12/2016 02:52 pm
for example , a page's code is:
<div id="content"></div><script type="text/javascript" src="/*.php?aid=*&cid=*"></script>

when i use open every page, the code will become :
<div id="content"><center></center><img src="*.gif"></div>
and i can successfully donwnload the image,but it's tooooo slow.

when i choose use internal download code, the code doesn't change,but when i open the page from OEE,it show a error icon. when i check its properties,it shows*/*.gif, but actually the image was not downloaded.

How can i do?
Oleg Chernavin
12/12/2016 02:53 pm
Can you please give me the address of the page and explain which image was not downloaded? I will check to see what is wrong there.

Thank you!

Best regards,
Oleg Chernavin
MP Staff
12/19/2016 05:34 pm
Sorry, the website can only be accessed in the LAN, so you can't open that page.
But i want to explain detailedly:

for example, the server's file is :

the page's code is:
<div id="content"></div><script type="text/javascript" src="/1.php?*"></script>

the php's code is:
var rptxt="/1.gif";rptxt=rptxt.replace(/%_%/g,2);rptxt=decodeURIComponent(rptxt);rptxt=rptxt.replace(/img_src/g,"img src");document.getElementById("content").innerHTML = rptxt;

when i use "open every page" to download the page,it's code will be:
<DIV id=content>
<IMG src="/1.gif"></DIV>
in this situation the 1.gif can be successfully downloaded and the page can be showed correctly.

when i use the "intranet download code" to download the page,it's code will not change:
<div id="content"></div><script type="text/javascript" src="/1.php?*"></script>
in this situation the 1.gif didn't be downloaded and the page can't be showed correctly with a small ico included a "X"

you can have a try to find what happen.

is this a bug?

so i ask how to download the picture in php.
Oleg Chernavin
12/19/2016 05:37 pm
Well, I need to see the page myself to understand how to fix it. Is it possible to publish this code on some public PHP server, so I could access it?

12/21/2016 03:42 am
I'm sorry that i'm not the admin of the server , so i can't do that.....
But i think that it's an easy thing for you to set a local server to do it.
Oleg Chernavin
12/21/2016 10:02 am
Can you make the download using the Internal mode, then make Tools - Backup of this downloaded Project and send the backup file to me to ?

I will see what is wrong there.

Thank you!

12/22/2016 01:27 pm
i have sent an email to you, the topic is "[John]Details"
maybe it doesn't meet your need.

i think that the problem is the original page will be changed when loaded the php so the changed page will be opened again to get the image, but OE doesn't do this like a normal browser.

i use chrome's developer tools to check the network and find that the original page will be loaded twice.

besides, i have used "download the missing files", but it doesn't work, too.that is say the .gif was still not be downloaded.

more besides, do your website have some problems? i can't post my reply just now.
Oleg Chernavin
12/24/2016 07:24 am
So far our support didn't forward me your E-mail. I wrote an E-mail to yuour address now just in case it was missed.