Binary request To A Text File On HTTP Server
Moderator: General Moderators
- neel_basu
- Forum Contributor
- Posts: 454
- Joined: Wed Dec 06, 2006 9:33 am
- Location: Picnic Garden, Kolkata, India
Binary request To A Text File On HTTP Server
Hello Everybody
Can Anyone Please tell Me
How Can I Place A Binary Request To A Text File On A http Server Through php ?
Can Anyone Please tell Me
How Can I Place A Binary Request To A Text File On A http Server Through php ?
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
You won't be able to do it through a standard http request, unless you have some sort of script which serves files. If you wanted to use the file system functions to serve the file, they must reside on the same server as the file, or else the php will be parsed.
Otherwise, you can use http://php.net/ftp
p.s: how come you capitalize every word, it makes reading difficult
Otherwise, you can use http://php.net/ftp
p.s: how come you capitalize every word, it makes reading difficult
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
unless you configure apache to not run .php files through the php parser, no. If you could, this would be a massive security risk. You should consider using subversion if your wanting to synchronize your codebase among several machines.neel_basu wrote:Then Arn't There Any Way To Copy A File From A Server To localhost
without a http Request ??
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
I guess you want to build some sort of coding site with examples.
When you install the apache php module you (usually) add the line AddType application/x-httpd-php .php to httpd.conf telling the apache all files with the suffix .php are of the mime type application/x-httpd-php. The php module registered as handling this mime type, therefore apache lets php handle requests for .php files.
The module registers another type, application/x-httpd-php-source, see http://www.php.net/manual/en/install.unix.apache2.php step 15
Let's say you have the directory /home/www/htdocs/php_scripts containing all your example scripts. Now you can add an alias to httpd.conf and set .php to the mime type for source highlightingWhile accessing the file via http://your.serv.er/php_scripts/test.php gets the script executed http://your.serv.er/php_source/test.php will print/highlight the same file.
Make sure you understand what this is all about before you try it on a "real" webserver.
see http://httpd.apache.org/docs/2.2/mod/qu ... rence.html
When you install the apache php module you (usually) add the line AddType application/x-httpd-php .php to httpd.conf telling the apache all files with the suffix .php are of the mime type application/x-httpd-php. The php module registered as handling this mime type, therefore apache lets php handle requests for .php files.
The module registers another type, application/x-httpd-php-source, see http://www.php.net/manual/en/install.unix.apache2.php step 15
Let's say you have the directory /home/www/htdocs/php_scripts containing all your example scripts. Now you can add an alias to httpd.conf and set .php to the mime type for source highlighting
Code: Select all
Alias /php_source /home/www/htdocs/php_scripts
<Location /php_source>
AddType application/x-httpd-php-source .php
</Location>Make sure you understand what this is all about before you try it on a "real" webserver.
see http://httpd.apache.org/docs/2.2/mod/qu ... rence.html