...">

Can I upload an image without an image name?

Can I upload an image without an image name? Like this:

<img src="http://www.example.com" />

The reason for using the URL is that each time a different image appears in the picture, so the name of the image is dynamic.

I have Googled, but I can not find a solution.

+4
source share
3 answers

Yes this!

Suppose you can use php on your server http://www.example.com/

If you add index.phpwith this code:

<?php
    $file = '../image.jpg';
    $type = 'image/jpeg';

    header('Content-Type:'.$type);
    header('Content-Length: ' . filesize($file));
    readfile($file);
?>

http://www.example.com/ going to return an image (with the correct MIME), which can be read as follows: <img src="http://www.example.com" />

0
source

Oh sure.

, HTTP-/. - :

http://www.example.com/image.jpg

, . , , HTTP-. - , , . - , HTTP ( HTTP ).

, , - , . , - , . HTTP HTTP, .

, - :

http://www.example.com/someHandler?id=123

, , id. , . , / .

HTTP- "" ( ), URL- . URL- . , .

+4

http://www.example.com, - , . URL .jpg .png . URL-, .

0

Source: https://habr.com/ru/post/1526756/


All Articles