Page 1 of 1
protect file from http access
Posted: Thu May 21, 2009 4:05 am
by manoj_jnics1
I want to protect a file from the users, which prints xml
The xml output would be used for flash programming
for example :
http://www.mydomain.com/xml.php
I want to protect the file from http access.
At this time user can veiw the output xml.php while I want to give this output to a flash player olny.
If I keep this file outside of public_html, it does not give output to flash. Can I give xml output using php command line.
--Manoj
Re: protect file from http access
Posted: Thu May 21, 2009 4:37 am
by JAB Creations
Re: protect file from http access
Posted: Thu May 21, 2009 4:38 am
by jaoudestudios
Put it in a subfolder and use a .htaccess file to protect it from http
Re: protect file from http access
Posted: Thu May 21, 2009 9:19 am
by kaisellgren
jaoudestudios wrote:Put it in a subfolder and use a .htaccess file to protect it from http
If you block the HTTP -protocol access, then how is your Flash application going to fetch this XML data? If the Flash application uses a different protocol, then anyone else can use this same protocol, too. Blocking a protocol is not really helping, he needs authentication as previously stated by JAB Creations.
Re: protect file from http access
Posted: Thu May 21, 2009 9:36 am
by jaoudestudios
kaisellgren wrote:jaoudestudios wrote:Put it in a subfolder and use a .htaccess file to protect it from http
If you block the HTTP -protocol access, then how is your Flash application going to fetch this XML data? If the Flash application uses a different protocol, then anyone else can use this same protocol, too. Blocking a protocol is not really helping, he needs authentication as previously stated by JAB Creations.
Fair point, but from what I remember there is a way to only allow local access to that php file in the subdirectory with the use of .htaccess file.
Re: protect file from http access
Posted: Thu May 21, 2009 9:37 am
by kaisellgren
jaoudestudios wrote:Fair point, but from what I remember there is a way to only allow local access to that php file in the subdirectory with the use of .htaccess file.
Probably, although I doubt this Flash application runs locally on the web server.

Re: protect file from http access
Posted: Thu May 21, 2009 2:50 pm
by leonel.machava
kaisellgren wrote:jaoudestudios wrote:Fair point, but from what I remember there is a way to only allow local access to that php file in the subdirectory with the use of .htaccess file.
Probably, although I doubt this Flash application runs locally on the web server.

Hi guys!
If the flash application is deployed on a machine with a fixed address (IP or DNS), we can use an .htaccess file. The inconvenience happens when the flash application later changes or uses another address. By the other side, using the authentication approach the flash application could be deployed at an arbitrary address. The authentication approach is scalable.
Personally, I would go by the authentication approach.
To implement this you can use built-in HTTP Authentication or a customized one.
If you need help applying this approach just let us know.