|
Posted by Rik Wasmus on 11/22/07 00:36
On Thu, 22 Nov 2007 01:19:05 +0100, <jools@by.com> wrote:
> In article <op.t1516dhu5bnjuv@metallium.lan>, luiheidsgoeroe@hotmail.c=
om
> says...
> You said you did output some filecontents, not the name of a fil=3D
>> e. =3D
>>
>> In this case, there's practically no way the user wil ever be able to=
=3D
>>
>> download the image. An HTML tag is NOT sending the image, it's just =
=3D
>>
>> telling the browser where it can be fetched.
>>
>> If you need an dynamically created image displayed only once, and not=
=3D
>>
>> saved permanently as a file, point the HTML src attribute to a PHP =
>> scrip=3D
>> t, =3D
>>
>> possibly with some GET variables, and let that script output an image=
, =
>> =3D
>>
>> using the GD or ImageMagick libraries for instance.
>> -- =3D
Hmm, Gravity troubles?
> No Rik thats not correct - my fault - The image is not dynamically
> created its a file on the disk that is delete after use.
Euhm, I assume it's deleted by another request later on? Can't hardly be=
=
deleted in the current request with a subrequest for the image yet to co=
me?
> It was the text
> file I created.
And the rest of the reply is about an image. Now I'm confused :). What =
happens file-wise in your request? What gets created, what gets deleted,=
=
when, and why.
> Consider - these are the cases:
> If the link is not relative to the CWD the image is sent fine
Where are you sending an image? Not in this code. This code only tells a=
=
browser where an image can be fetched in the future...
> and deleted
> afterwards. Everything works as I want it to. (Except I need the imag=
es
> elsewhere)
>
> If the image is at a relative location to CWD and the image is deleted=
> after it should have already been sent (or GET-ed if you like) - it is=
> never seen.
As I would expect.
> The only thing that has changed between working and not working is the=
> image location from . to ../ or any other relative location.
I'd reexamine some things in you code carefully:
1. Is an image actually creted, and where? Change the filename to =
something unique you haven't used before (uniqid()?), and check for it =
(remove the unlink() temporarily).
2. Is the HTML src attribute actually pointing to that image, or perhaps=
=
an image in another directory with the same name?
3. Is an image actually deleted? (reintroduce the unlink(), check wether=
=
the file actually disappears.
-- =
Rik Wasmus
Navigation:
[Reply to this message]
|