Your Ad Here

New Post/Thread Notification: PHP Forum

Hello,

welcomewiki has just posted in the PHP Forum forum of Wiki Newforum under the title of PHP File Upload.

This thread is located at http://www.wikinewforum.com/showthread.php?t=5865

Here is the message that has just been posted:
***************
With PHP, it is possible to upload files to the server.



*Create an Upload-File Form*


To allow users to upload files from a form can be very useful.
Look at the following HTML form for uploading files:


<html>
<body> <form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form> </body>
</html>

Notice the following about the HTML form above:

* The enctype attribute of the <form> tag specifies which content-type to use when submitting the form. "multipart/form-data" is used when a form requires binary data, like the contents of a file, to be uploaded
* The type="file" attribute of the <input> tag specifies that the input should be processed as a file. For example, when viewed in a browser, there will be a browse-button next to the input field


*Note:* Allowing users to upload files is a big security risk. Only permit trusted users to perform file uploads.

*Create The Upload Script*

The "upload_file.php" file contains the code for uploading a file:


<?php
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
}
?>

By using the global PHP $_FILES array you can upload files from a client computer to the remote server.


The first parameter is the form's input name and the second index can be either "name", "type", "size", "tmp_name" or "error". Like this:



* $_FILES["file"]["name"] - the name of the uploaded file
* $_FILES["file"]["type"] - the type of the uploaded file
* $_FILES["file"]["size"] - the size in bytes of the uploaded file
* $_FILES["file"]["tmp_name"] - the name of the temporary copy of the file stored on the server
* $_FILES["file"]["error"] - the error code resulting from the file upload

This is a very simple way of uploading files. For security reasons, you should add restrictions on what the user is allowed to upload.
***************

Your Ad Here

FREE TRAINING By World's No.1 Site Wikipedia

Hi

Here the SAP HR Real Blue Print: http://www.wikinewforum.com/showthread.php?t=1410


Join us World's Best FREE SAP HR Training @ www.wikinewforum.com


Online Training (Any time you can log-in)

FREE SAP HR TRAINING

WITH REAL TIME SCREEN SHOTS

By World's No.1 Site Wikipedia



Duration: 40 Days Venue: Wikipedia Website

Timings: Any time you can open and can take training

Support: Any time 24/7

We called as Special training because:

  • Real Time Employees will teach & answers your queries
  • Real Time Scenarios
  • Real Time System screen shots step by step configuration
  • Post training support like Resume & Interview tips with exact requirement, we provide top companies HR email ID's and every day vacancy list.

Special Topics apart from general topics:

  • We teach special topics like following where no any dare to reach
  • Payroll & Time Schema's
  • Payroll & Time PCR's (Personal Calculation Rules)
  • Rates of Pay
  • Factoring/Pro-ration
  • Wage type Valuation
  • Time Quota's & Time Types
  • Time Evaluation
  • Absence Valuation
  • Integration wit FICO & other Modules
  • And more and more....list will not stop
  • Totally End-to-End implementation Process

Visit our Website

www.wikinewforum.com

Free Demo

http://www.wikinewforum.com/showthread.php?p=10222#post10222

Reach us

info@wikinewforum.com

Presented

World No. 1 Site - Wikipedia

Our Aim is to provide FREE SAP Training, hope you join.