Results 1 to 6 of 6

Thread: How to use PUT method in PHP?

  1. #1
    Join Date
    May 2009
    Posts
    201

    How to use PUT method in PHP?

    Hello friends,
    I have recently started doing the advanced coding in PHP programming language. I want to use the PUT method in my form so that I can store the PUT method used by the browsers. Instead of searching it on Web, I thought that posting here would be helpful, since you provide the good solutions.!! So please explain me how to use PUT method in PHP? Expecting some useful help from your side as soon as possible.!!

  2. #2
    Join Date
    Mar 2008
    Posts
    349

    Re: How to use PUT method in PHP?

    PHP supports the HTTP PUT method used by browsers to store files on a server. PUT requests are much simpler than a file upload using POST requests and they look like, the following example :
    Code:
    PUT / path / filename.html HTTP/1.1
    Normally, this means that the remote client will save the following data in the file: / path / filename.html your disk.

  3. #3
    Join Date
    Jul 2006
    Posts
    289

    Re: How to use PUT method in PHP?

    PHP provides support for the HTTP PUT method used by some clients to store files on a server. PUT requests are much simpler than a file upload using POST requests. Which means that the remote client will save the following data in the file: / path / filename.html your disk. This is obviously not very secure to leave Apache or PHP overwrite any file in the tree. To avoid this, we must first tell the server that you want a certain PHP script to manage the application.
    Signatures reduce available bandwidth

  4. #4
    Join Date
    Nov 2008
    Posts
    1,192

    Re: How to use PUT method in PHP?

    The coding mentioned above by the 'Warner' is not very secure to leave Apache or PHP overwrite any file in the tree. To avoid this, we must first tell the server that you want a certain PHP script to manage the application. With Apache, there is a directive to this: Script. It can be placed anywhere in the configuration file of Apache. In general, the webmasters put in <Directory> the block, or perhaps block <VirtualHost>.

  5. #5
    Join Date
    Nov 2008
    Posts
    996

    Re: How to use PUT method in PHP?

    I have provided you with the coding that can be helpful for saving HTTP by using the PUT files, so just take a glance on the following code :
    PHP Code:
    <?php
    $putdata 
    fopen("php://input""r");

    $fp fopen("mydemofile.ext""w");

    while (
    $data fread($putdata2048))
      
    fwrite($fp$data);

    fclose($fp);
    fclose($putdata);
    ?>

  6. #6
    Join Date
    Jan 2008
    Posts
    1,521

    Re: How to use PUT method in PHP?

    The following is the directive Apache that you can use for loading PUT method :
    Code:
    Script PUT /put.php
    This tells Apache to send all PUT requests for URIs that match the context in which you put this line to the put.php script. This assumes you have PHP enabled for that supports files of type. Php extension and PHP is active. The destination resource for all PUT requests to this script must be the script itself, not the name of the file the file must be downloaded.

Similar Threads

  1. Which method should I use to mod PS2
    By Jalela in forum Portable Devices
    Replies: 6
    Last Post: 03-07-2011, 10:30 AM
  2. Method overriding versus method hiding in C#
    By ^MALARVIZHI^ in forum Software Development
    Replies: 4
    Last Post: 25-12-2010, 06:25 AM
  3. Is it possible to call destroy() method within init() Method?
    By Level8 in forum Software Development
    Replies: 3
    Last Post: 10-12-2009, 08:36 AM
  4. What is method overriding and method overloading in java
    By beelow in forum Software Development
    Replies: 3
    Last Post: 17-11-2009, 08:20 AM
  5. Java: How can I call one method in another method?
    By biohazard 76 in forum Software Development
    Replies: 3
    Last Post: 16-07-2009, 07:12 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,287,065.13580 seconds with 17 queries