File: index.php

Recommend this page to a friend!
  Classes of Pravin Sonawane  >  PHP CURL Upload File  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: index page
Class: PHP CURL Upload File
Send an uploaded file to a remote server with CURL
Author: By
Last change: Added class
Date: 4 years ago
Size: 1,052 bytes
 

Contents

Class file image Download
<?php
   
include("include.php");
   
$msg = '';
    if (isset(
$_POST['btnUpload']))
    {
       
$up = new curlupload();
       
$r = $up->request($_FILES,$_FILES['file']['name']);
        if (
$r == true)
           
$msg = "File Uploaded Sucessesfully...";
        else
           
$msg = $r;
    }
?>
<html>
<head>
<title>File Upload Using PHP and cURL - php-guru.in</title>
<style type="text/css">
body
{
    font-family:Verdana, Geneva, sans-serif;
    font-size:12px;
}
</style>
</head>
<body>
<font style="color: red;"><?php echo ucfirst($msg);?></font><br>
<br>
<table border="1" cellspacing="0" cellpadding="3" style="border-collapse:collapse;" bordercolor="#CCCCCC">
  <form action="" method="post" name="frmUpload" enctype="multipart/form-data">
    <tr>
      <td>Upload</td>
      <td align="center">:</td>
      <td><input name="file" type="file" id="file"/></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td align="center">&nbsp;</td>
      <td><input name="btnUpload" type="submit" value="Upload" /></td>
    </tr>
  </form>
</table>
</body>
</html>


For more information send a message to info at phpclasses dot org.