Best Photo Uploading Scripts for a Company Website

Asked By 0 points N/A Posted on -
qa-featured

 

 

Hello,

What is the best photo uploading script? Like any other social networking website, I am just wondering what is the simplest and easiest scripting codes for this subject. I am planning to put up a photo uploading category in our company website to see the profile of person who comes in and out in our forum. I need your idea based on your web programming experiences.

 

Waiting for your support, thank you.

SHARE
Answered By 0 points N/A #180321

Best Photo Uploading Scripts for a Company Website

qa-featured

Hello,

There are many ways of writing up codes for image upload. It all depends on the type of image, that is, the extension you want to be uploaded such as jpg, GIF. A simple image upload code can be as shown below:

Name this code file upload.php

<table >

<tr>
<td width=20%>
<td width=80%, align='left'>

 <form action="uploader.php" method="post"  enctype="multipart/form-data">
 <input type="hidden" name="MAX_FILE_SIZE" value="20000000" /><br />
<input type="file" name="uploadedfile"><br /><br />
 <input type="submit" value="Upload file" >
 </form>
 
  </tr>
</table>

Name this file codes uploader.php

<?php
// Where the file is going to be placed
$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
    echo "<div class='finemsg'>The file has been uploaded successfully</div>";
    include 'upload.php';
} else{
    echo "<div class='errmsg'>There was an error uploading the file, please try again!</div>";
    include 'upload.php';
}
?>
 

Thank you.

Login/Register to Answer

Related Questions