Monday 21, May 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    About Us    |    Contact Us

  Uploading file using php

Here is a simple script to upload file using php. we are using move_uploaded_file function to upload file. The move_uploaded_file function needs two parameters
1. The path of the temporary file.
2. The path where it is to be moved to.
Cut & Paste Script
<?php

$target_path = "uploads/";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}

?>
 
   
     RELATED SCRIPTS
 
Reading xml file using php
The easiest way to read a well-formed XML file is to use the Document Object Model (DOM) library compiled into some installations of PHP. The DOM library reads the entire XML document into memory and represents it as a tree of nodes. Here is a script which reads the xml file....more »
Category : PHP Examples Hits : 755
   
Exporting data from MySql table to CSV using PHP
Here is a code example for exporting data from MySql table to a CSV File. CSV file format is a file type that stores tabular data usually processed in applications like Microsoft Excel....more »
Category : PHP Examples Hits : 1469
   
creating xml file using php
Here is a script to create xml file using php DOM....more »
Category : PHP Examples Hits : 554
   
Email validation using regular expression php
Here is a php script to validate email address. We are using regular expression for validation....more »
Category : PHP Examples Hits : 1009
   
Comparing two arrays using php
This code example will take two arrays and compares 2nd array with 1st. It will show the list of elements which are not found in the first array....more »
Category : PHP Examples Hits : 649
   
   
SCRIPT CATEGORIES
 
  C Programs
C Programs scripts
  C++ Programs
C++ Programs scripts
  Java Programs
Java Programs scripts
  JavaScript Examples
JavaScript Examples scripts
  PHP Examples
PHP Examples scripts
  VBScript Examples
VBScript Examples scripts
 
 
 
POPULAR E-BOOKS
 
Download Magnetic Sponsoring Ebook Magnetic Sponsoring
   
Download  Squeeze Page Secrets Ebook Squeeze Page Secrets
   
Download Introduction to Computer Science using Java Ebook Introduction to Computer Science using Java
   
Download How To Accelerate Your Internet - A practical guide to Bandwidth Management and Optimisation using Open Source Software Ebook How To Accelerate Your Internet - A practical guide to Bandwidth Management and Optimisation using Open Source Software
   
Download How To Design Programs: An Introduction To Programming and Computing  Ebook How To Design Programs: An Introduction To Programming and Computing
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz