Andrey
Andrey

Reputation: 2729

How to get source file by php script from .htaccess Action/AddHandler

I making a simple script to add a watermark image to all image files in directory.

So, I have .htaccess:

AddHandler watermarked .jpg 
AddHandler watermarked .jpeg 
AddHandler watermarked .gif 
AddHandler watermarked .png 

Action watermarked /spimg/vitowatermark.php 

So, now on each image request from this directory, vitowatermark.php is working.

How can I get source image file, user requested from my PHP script, to put watermark on it and generate answer?

Thanks.

Upvotes: 1

Views: 424

Answers (1)

Andrey
Andrey

Reputation: 2729

Cool, I find answer to this question myself.

$filename =  $_SERVER["PATH_TRANSLATED"];

Upvotes: 1

Related Questions