Making an Upload image feature

I’m designing a flash website and I want a feature whereby the user can upload an image and it gets sent to an email at the press of a button. What is the easiest way for this to be done?
Thanks in advance!

you'll need to find someone to do this for you or you'll need to advance your skill beyond beginner because this is an intermediate-level task.
you can start by using google to search for:  flash <your actionscript version> upload file tutorial
then once you've mastered that, search for:  <your server-side scripting language> email attachment tutorial

Similar Messages

  • How should i include an upload image feature with the specific size conditions?

    I have to include this feature by custom webpart coding...pls help.

    Hi, 
    Please check the uploaded file size . refer below links .
    using Javascript:
    http://www.webcodeexpert.com/2014/07/javascript-to-validate-file-size-before.html
    Server side:
    http://forums.asp.net/t/1373336.aspx
    Don't forget to mark it as an Answer if it resolves your problem,vote me as helpful if it useful.
    Mahesh

  • Upload image in an html form to be emailed

    Hi everyone. Here is another one of my last minute, hurry up and wait requests.
    I have to create a form that will enable the viewer to upload an image and send the
    form on its way to a predetermined email address. This is for a contest starting tomorrow.
    The form has been made and works. The only thing I haven't worked out yet is the "upload image"
    feature. This is absolutely necessary and must be included. I have tested this several times and all the data
    comes thru. What I need is for an image to go along with the form fields and appear when the email is opened.
    With all due respect I do not have a very long learning curve here so if anyone can just provide
    me with the code, both html and php, instruct me exactly where to place it I would be
    extremely appreciative.
    here is the temporary link:
    Sirui/Argraph Wildlife-Landscape Photo Contest
    The image upload button will be in between the two horizontal rules towards the bottom of the form;
    above the submit/reset buttons.
    Thanks in advance as always.
    -Cliff-

    Below is the code and php for your complete form together with the file upload field and code. How you style the form and validate the form fields (if your going to) is down to you. Change the email address marked in red to that of the recipient you want the information to go to.
    You need to copy all the code and save it with a php extension so instead of:
    SiruiWildlifePhotoContestEntryForm.html
    This:
    SiruiWildlifePhotoContestEntryForm.php
    Obvioulsy being php it only works if the file is on a php enabled server so if you dont have a local testing server you need to upload it to your remote server before it will work.
    <?php
    if(isset($_POST['Submit']))
    //The form has been submitted, prep a nice thank you message
    $output = '<h1>Thanks for your file and message!</h1>';
    //Set the form flag to no display (cheap way!)
    $flags = 'style="display:none;"';
    //Deal with the email
    $to = 'yourEmailAddress.com';
    $subject = 'Competition Entry';
    $LastName = ($_POST['LastName']);
    $FirstName = ($_POST['FirstName']);
    $Email = ($_POST['Email']);
    $Phone = ($_POST['Phone']);
    $Address1 = ($_POST['Address1']);
    $Address2 = ($_POST['Address2']);
    $City = ($_POST['City']);
    $State = ($_POST['State']);
    $Zip = ($_POST['Zip']);
    $Dealer = ($_POST['Dealer']);
    $TripodMonopodHead = ($_POST['TripodMonopodHead']);
    $CameraLens = ($_POST['CameraLens']);
    $ImageEntry = ($_POST['ImageEntry']);
    $DepositWhere = ($_POST['DepositWhere']);
    $YouTubePage = ($_POST['YouTubePage']);
    $attachment = chunk_split(base64_encode(file_get_contents($_FILES['file']['tmp_name'])));
    $filename = $_FILES['file']['name'];
    $boundary =md5(date('r', time()));
    $headers = "From: [email protected]\r\nReply-To: [email protected]";
    $headers .= "\r\nMIME-Version: 1.0\r\nContent-Type: multipart/mixed; boundary=\"_1_$boundary\"";
    $message = "Last Name: $LastName\n\n";
    $message .= "First Name: $FirstName\n\n";
    $message .= "Email: $Email\n\n";
    $message .= "Phone: $Phone\n\n";
    $message .= "Address1: $Address1\n\n";
    $message .= "Address2: $Address2\n\n";
    $message .= "City: $City\n\n";
    $message .= "State: $State\n\n";
    $message .= "Zip: $Zip\n\n";
    $message .= "Dealer: $Dealer\n\n";
    $message .= "Tripod Monopod Head: $TripodMonopodHead\n\n";
    $message .= "Camera Lens: $CameraLens\n\n";
    $message .= "Deposit Where: $DepositWhere\n\n";
    $message .= "You Tube Page: $YouTubePage\n\n";
    $message.="This is a multi-part message in MIME format.
    --_1_$boundary
    Content-Type: multipart/alternative; boundary=\"_2_$boundary\"
    --_2_$boundary
    Content-Type: text/plain; charset=\"iso-8859-1\"
    Content-Transfer-Encoding: 7bit
    $message
    --_2_$boundary--
    --_1_$boundary
    Content-Type: application/octet-stream; name=\"$filename\"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment
    $attachment
    --_1_$boundary--";
    mail($to, $subject, $message, $headers);
    ?>
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>MailFile</title>
    </head>
    <body>
    <?php echo $output; ?>
    <form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" <?php echo $flags;?>>
    <p><label for="LastName" class="barheader">Last Name:</label>
    <input name="LastName" type="text" id="LastName" size="28" maxlength="50" />
    </p>
    <p><label for="FirstName" class="barheader">First Name:</label>
    <input name="FirstName" type="text" id="FirstName" size="28" maxlength="50" />
    </p>
    <p><label for="Email" class="barheader">Email:</label>
    <input name="Email" type="text" id="Email" size="50" maxlength="75" />
    </p>
    <p><label for="Phone" class="barheader">Phone:</label>
    <input name="Phone" type="text" id="Phone" size="12" maxlength="15" />
    </p>
    <p><label for="Address1" class="barheader">Address 1:</label>
    <input name="Address1" type="text" id="Address1" size="75" maxlength="100" />
    </p>
    <p><label for="Address2" class="barheader">Address 2:</label>
    <input name="Address2" type="text" id="Address2" size="75" maxlength="100" />
    </p>
    <p><label for="City" class="barheader">City:</label>
    <input name="City" type="text" id="City" size="33" />
    </p>
    <p><label for="State"><span class="barheader">State:</span></label>
    <input name="State" type="text" id="State" size="2" maxlength="2" />
    </p>
    <p><label for="Zip" class="barheader">Zip:</label>
    <input name="Zip" type="text" id="Zip" size="10" maxlength="10" />
    </p><label for="Dealer" class="barheader">Dealer:</label>
    <input name="Dealer" type="text" id="Dealer" size="100" maxlength="150" />
    </p>
    <p><label for="Tripod/Monopod/Head Used:" class="barheader">Tripod/Monopod/Head Used:</label>
    <input name="TripodMonopodHead" type="text" id="Tripod/Monopod/Head Used:" size="75" maxlength="100" />
    </p>
    <p><label for="YouTubePage" class="barheader">Camera/Lens Used:</label>
    <input name="CameraLens" type="text" id="Camera/Lens Used:" size="75" maxlength="100" />
    </p>
    <p><label for="Image/Entry:" class="barheader">Image/Entry #:</label>
    <input name="ImageEntry" type="text" id="Image/Entry:" size="25" maxlength="25" />
    </p>
    <p></p>Where will you deposit your entry?:</p>
    <p><label for="DepositWhere"></label>
    <input name="DepositWhere" type="text" id="DepositWhere:" size="20" maxlength="50" />
    </p>
    <p><label for="YouTubePage" class="barheader">For YouTube Videos: URL to your YouTube page:</label>
    <input name="YouTubePage" type="text" id="YouTubePage" size="50" maxlength="100" />
    </p>
    <p>
    <label for="file">Attach File</label> <input type="file" name="file" id="file"></p>
    <input type="submit" name="Submit" id="Submit" value="Submit" />
    <input type="reset" name="Reset" id="Reset" value="Reset" />
    </form>
    </body>
    </html>

  • Storing Uploaded Image Path into Mysql

    Hi I am developing a cms and am using the code David gives in his book PHP Solutions,  everything works fine but I can't work out how to extract the uploaded path so that it is stored in my table.
    Help would be really appreciated, I am making good progress in learning the php especially with David's books but am still struggling when it comes to having to customized the code.
    The code for the upload.php is as follows,
    <?php
    class Gp1_Upload{
      protected $_uploaded = array();
      protected $_destination;
      protected $_max = 51200;
      protected $_messages = array();
      protected $_permitted = array('image/gif',
                                    'image/jpeg',
                                    'image/pjpeg',
                                    'image/png');
      protected $_renamed = false;
      public function __construct($path) {
        if (!is_dir($path) || !is_writable($path)) {
          throw new Exception("$path must be a valid, writable directory.");
        $this->_destination = $path;
        $this->_uploaded = $_FILES;
      public function getuploadpath (){
      public function getMaxSize() {
        return number_format($this->_max/1024, 1) . 'kB';
      public function setMaxSize($num) {
        if (!is_numeric($num)) {
          throw new Exception("Maximum size must be a number.");
        $this->_max = (int) $num;
      public function move($overwrite = false) {
        $field = current($this->_uploaded);
        if (is_array($field['name'])) {
          foreach ($field['name'] as $number => $filename) {
            // process multiple upload
            $this->_renamed = false;
            $this->processFile($filename, $field['error'][$number], $field['size'][$number], $field['type'][$number], $field['tmp_name'][$number], $overwrite);   
        } else {
          $this->processFile($field['name'], $field['error'], $field['size'], $field['type'], $field['tmp_name'], $overwrite);
      public function getMessages() {
        return $this->_messages;
      protected function checkError($filename, $error) {
        switch ($error) {
          case 0:
            return true;
          case 1:
          case 2:
            $this->_messages[] = "$filename exceeds maximum size: " . $this->getMaxSize();
            return true;
          case 3:
            $this->_messages[] = "Error uploading $filename. Please try again.";
            return false;
          case 4:
            $this->_messages[] = 'No file selected.';
            return false;
          default:
            $this->_messages[] = "System error uploading $filename. Contact webmaster.";
            return false;
      protected function checkSize($filename, $size) {
        if ($size == 0) {
          return false;
        } elseif ($size > $this->_max) {
          $this->_messages[] = "$filename exceeds maximum size: " . $this->getMaxSize();
          return false;
        } else {
          return true;
      protected function checkType($filename, $type) {
        if (empty($type)) {
          return false;
        } elseif (!in_array($type, $this->_permitted)) {
          $this->_messages[] = "$filename is not a permitted type of file.";
          return false;
        } else {
          return true;
      public function addPermittedTypes($types) {
        $types = (array) $types;
        $this->isValidMime($types);
        $this->_permitted = array_merge($this->_permitted, $types);
      protected function isValidMime($types) {
        $alsoValid = array('image/tiff',
                           'application/pdf',
                           'text/plain',
                           'text/rtf');
          $valid = array_merge($this->_permitted, $alsoValid);
        foreach ($types as $type) {
          if (!in_array($type, $valid)) {
            throw new Exception("$type is not a permitted MIME type");
      protected function checkName($name, $overwrite) {
        $nospaces = str_replace(' ', '_', $name);
        if ($nospaces != $name) {
          $this->_renamed = true;
        if (!$overwrite) {
          $existing = scandir($this->_destination);
          if (in_array($nospaces, $existing)) {
            $dot = strrpos($nospaces, '.');
            if ($dot) {
              $base = substr($nospaces, 0, $dot);
              $extension = substr($nospaces, $dot);
            } else {
              $base = $nospaces;
              $extension = '';
            $i = 1;
            do {
              $nospaces = $base . '_' . $i++ . $extension;
            } while (in_array($nospaces, $existing));
            $this->_renamed = true;
        return $nospaces;
      protected function processFile($filename, $error, $size, $type, $tmp_name, $overwrite) {
        $OK = $this->checkError($filename, $error);
        if ($OK) {
          $sizeOK = $this->checkSize($filename, $size);
          $typeOK = $this->checkType($filename, $type);
          if ($sizeOK && $typeOK) {
            $name = $this->checkName($filename, $overwrite);
            $success = move_uploaded_file($tmp_name, $this->_destination . $name);
            if ($success) {
                $message = "$filename uploaded successfully";
                if ($this->_renamed) {
                  $message .= " and renamed $name";
                $this->_messages[] = $message;
            } else {
              $this->_messages[] = "Could not upload $filename";
    ?>
    The code for my form page is this
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <?php
    //THE FOLLOWING CODE IS FOR THE UPLOADING OF IMAGES AND FILES
    // set the max upload size in bytes
    $max = 51200;
    if (isset ($_POST ['submit']))
                //define the path to the upload folder
                $destination = 'uploads/';
                require_once('classes/Upload.php');
                try {
                    $upload = new Gp1_Upload($destination);
                    $upload->setMaxSize($max);
                    $upload->move();
                    $result = $upload->getMessages();
                } catch (Exception $e) {
                    echo $e->getMessage();
    // END OF UPLOADING OF IMAGES AND FILES
    ?>
    <form id="newvenue" action="" method="post" enctype="multipart/form-data" >
          <?php
               // THIS CODE DISPLAYS ERROR MESSAGES FOR THE FILE UPLOADS
              if (isset($result)){
              echo '<ul>';
              foreach ($result as $message){
                  echo "<li>$message</li>";
              echo '</ul>';
           ?>
      <table id="neweventdisplay" cellpadding="5"  border="0">
        <tr>
      <td></td>
      <td><input type="hidden" name="user_id"  value="" /></td>
      </tr>
      <tr>
      <td></td>
        <td>Organisers Name</td>
        <td><input class="input80px" id="org_name" name="org_name" type="text" /> </td>
      </tr>
      <tr>
      <td></td>
      <td><label for="image">Upload image:</label></td>
      <td><p>
    <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max; ?>" />
    <input type="file" name="image" id="image" />
    </p></td>
    </tr>
      <tr>
      <td></td>
      <td>Details about your upload</td>
      <td><input class="input80px" id="org_uploadcapt" name="org_uploadcapt" type="text"  /></td>
    </tr>
      <tr>
      <td></td>
      <td><input type="submit" name="submit" id="submit" value="upload"></td>
      </tr>
      <tr>
      <td class="heading"> </td>
      <td></td>
      </tr>
    </table>
    </form>
    <prep>
    <?php
    if (isset ($_POST ['submit'])){
        print_r($_FILES);}
        ?>
        </prep>
    </body>
    </html>

    Hi David
    Thank you very much for your help.  I had continued to work on the code and had worked out how to input the image path into the database but it was using the original filename, so when every it is changed it did not work.  The code in my page at that point was the following,
    <?php     // 2. NEW USER REGISTRATION<br />
            include_once ("includes/form_functions.inc.php");
            $max = 100000;
            $destination = 'uploads/';
            // START FORM PROCESSING FOR A NEW REGISTRATION
            if (isset($_POST['submit'])) { // Form has been submitted.
            $errors = array();
            // perform validations on the form data
            $required_fields = array('org_name');
            $errors = array_merge($errors, check_required_fields($required_fields, $_POST));    
            $required_numberfields = array('user_id');
            $errors = array_merge($errors, check_number_fields($required_numberfields, $_POST));
            $fields_with_lengths = array('org_name' => 36, 'org_website' => 100, 'org_contact' => 40,  'org_conemail' => 80, 'org_contel' => 30);
            $errors = array_merge($errors, check_max_field_lengths($fields_with_lengths, $_POST));
            /*Here I am using trim as well as ucwords, this function converts the first letter of each work into a capital letter,  I am using this only on the
            firstname and surname to ensure that the data is how I want it as it is going  into the database,  The better the data is preformated the better the data
            swill be within the database.*/
            $org_name = trim(strtolower(mysql_prep($_POST['org_name'])));
            $org_website = trim(strtolower(mysql_prep($_POST['org_website'])));
            $org_contact = trim(strtolower (mysql_prep($_POST['org_contact'])));
            $org_conemail = trim(strtolower (mysql_prep($_POST['org_conemail'])));
            $org_contel = strtolower (mysql_prep($_POST['org_contel']));
            $userid = $_POST['user_id'];
            $org_uploadcapt = $_POST['org_uploadcapt'];
            $image = $_FILES['image'];
            /*Here is the code that takes the variable captured from the input form and matches it  up with the appropriate field in the database.  An important point with insertion is that  the variables are in the same order as the mysql field names, there will be an error if the number of variables does not match the number of field names.  Note that there is no entry for the user id as this is an auto increment file within mysql and so is not needed to be entered*/
            if ( empty($errors) ) {
                $sql = "INSERT INTO organiser
                          (org_name, org_website, org_contact, org_conemail, org_contel, user_id, org_uploadurl, org_uploadcapt)
                          VALUES
                          ('{$org_name}', '{$org_website}', '{$org_contact}', '{$org_conemail}', '{$org_contel}', '{$userid}', '{$destination}".$image['name']."', '{$org_uploadcapt}' )";
                $result = mysql_query($sql, $connection);
                if ($result) {
                    $message = "The organiser was successfully created.<br />";
                } else {
                    $message = "I am sorry but the organiser could not be added.";
                    $message .= "<br />" . mysql_error();
                } else {
                    /* this counts the number of errors and informs the user of how many fields were
                    incorrectly entered*/
                if (count($errors) == 1) {
                    $message = "There was 1 error in the form.";
                } else {
                    $message = "There were " . count($errors) . " errors in the form.";
        } else { // Form has not been submitted.
            $org_name = "";
            $org_website = "";
            $org_contact = "";
            $org_conemail = "";
            $org_contel = "";
            $userid = "";
            $org_uploadcapt = "";
    //THE FOLLOWING CODE IS FOR THE UPLOADING OF IMAGES AND FILES
    // set the max upload size in bytes
    if (isset ($_POST ['submit']))
                //define the path to the upload folder
                // Use This On The Local Hosting Machine
                //$destination = 'C:/upload_test/';
                // Use This On The Live Server
                require_once('classes/Upload.php');
                try {
                    $upload = new Gp1_Upload($destination);
                    $upload->setMaxSize($max);
                    $upload->move();
                    $result = $upload->getMessages();
                } catch (Exception $e) {
                    echo $e->getMessage();
    // END OF UPLOADING OF IMAGES AND FILES
    ?>
    <title>Horse Events</title>
    <?php include_once("includes/meta.inc.php");?>
    <?php include_once("includes/cssfavgoogle.inc.php");?>
    <link href="css/adminpanel.css" rel="stylesheet" type="text/css" />
    <style>
    input[type="number"] {
        width:40px;
    </style>
    </head>
    <body>
    <div id="wrapper">
        <div id="admincontent">
    <form id="newvenue" action="neworganiser.php" method="post" enctype="multipart/form-data" >
          <?php if (!empty ($message)) {echo "<p class=\"message\">" . $message . "</p>";} ?>
          <?php if (!empty ($errors)) {display_errors($errors); } ?>
          <?php
              // THIS CODE DISPLAYS ERROR MESSAGES FOR THE FILE UPLOADS
              if (isset($result)){
              echo '<ul>';
              foreach ($result as $message){
                  echo "<li>$message</li>";
              echo '</ul>';
           ?>
    <br />
          <table id="neweventdisplay" cellpadding="5"  border="0">
        <tr>
      <td></td>
      <td><input type="hidden" name="user_id"  value="<?php echo $url_userid ['user_id']; ?>" /></td>
      </tr>
      <tr>
      <td> <span class="compuls">*</span></td>
        <td>Organisers Name</td>
        <td><input class="input80px" id="org_name" name="org_name" type="text" />
         </td>
      </tr>
          <tr>
          <td><span class="compuls">*</span></td>
        <td>Their Website</td>
        <td><input class="input80px" id="org_website" name="org_website" type="text" /></td>
      </tr>
        <tr>
        <td><span class="compuls">*</span></td>
        <td>Organisers Contact</td>
        <td><input id="org_contact" name="org_contact" type="text" />eg: Mrs Jean Kelly</td>
      </tr>
        <tr>
        <td><span class="compuls">*</span></td>
        <td>Contact Email</td>
        <td><input class="input80px" id="org_conemail" name="org_conemail" type="text" />
          </td>
      </tr>
        <tr>
        <td><span class="compuls">*</span></td>
      <td>Contact Tel No.</td>
      <td><input id="org_contel" name="org_contel" type="text" /></td>
      </tr>
      <tr>
      <td></td>
      <td><label for="image">Upload image:</label></td>
      <td><p>
    <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max; ?>" />
    <input type="file" name="image" id="image" />
    </p></td>
    </tr>
      <tr>
      <td></td>
      <td>Details about your upload</td>
      <td><input class="input80px" id="org_uploadcapt" name="org_uploadcapt" type="text"  /></td>
    </tr>
      <tr>
      <td></td>
      <td><input type="submit" name="submit" id="submit" value="Add Your Organiser"></td>
      </tr>
      <tr>
      <td class="heading"> </td>
      <td></td>
      </tr>
    </table>
    <a  class="delete" href="controlpanel.php">Cancel</a>
    </form>
        </div>
    I have added the code you kindly forwarded but am getting an error,  I am still trying to learn the basics of php and am unsure of what to do next, my php Upload.php now looks like
    <?php
    class Gp1_Upload{
      protected $_uploaded = array();
      protected $_destination;
      protected $_max = 100000;
      protected $_messages = array();
      protected $_permitted = array('image/gif',
                                    'image/jpeg',
                                    'image/pjpeg',
                                    'image/png');
      protected $_renamed = false;
      protected $_filenames = array();
      public function __construct($path) {
        if (!is_dir($path) || !is_writable($path)) {
          throw new Exception("$path must be a valid, writable directory.");
        $this->_destination = $path;
        $this->_uploaded = $_FILES;
      public function getMaxSize() {
        return number_format($this->_max/100000, 1) . 'kB';
      public function setMaxSize($num) {
        if (!is_numeric($num)) {
          throw new Exception("Maximum size must be a number.");
        $this->_max = (int) $num;
      public function move($overwrite = false) {
        $field = current($this->_uploaded);
        if (is_array($field['name'])) {
          foreach ($field['name'] as $number => $filename) {
            // process multiple upload
            $this->_renamed = false;
            $this->processFile($filename, $field['error'][$number], $field['size'][$number], $field['type'][$number], $field['tmp_name'][$number], $overwrite);   
        } else {
          $this->processFile($field['name'], $field['error'], $field['size'], $field['type'], $field['tmp_name'], $overwrite);
      public function getMessages() {
        return $this->_messages;
      protected function checkError($filename, $error) {
        switch ($error) {
          case 0:
            return true;
          case 1:
          case 2:
            $this->_messages[] = "$filename exceeds maximum size: " . $this->getMaxSize();
            return true;
          case 3:
            $this->_messages[] = "Error uploading $filename. Please try again.";
            return false;
          case 4:
            $this->_messages[] = 'No file selected.';
            return false;
          default:
            $this->_messages[] = "System error uploading $filename. Contact webmaster.";
            return false;
      protected function checkSize($filename, $size) {
        if ($size == 0) {
          return false;
        } elseif ($size > $this->_max) {
          $this->_messages[] = "$filename exceeds maximum size: " . $this->getMaxSize();
          return false;
        } else {
          return true;
      protected function checkType($filename, $type) {
        if (empty($type)) {
          return false;
        } elseif (!in_array($type, $this->_permitted)) {
          $this->_messages[] = "$filename is not a permitted type of file.";
          return false;
        } else {
          return true;
      public function addPermittedTypes($types) {
        $types = (array) $types;
        $this->isValidMime($types);
        $this->_permitted = array_merge($this->_permitted, $types);
      protected function isValidMime($types) {
        $alsoValid = array('image/tiff',
                           'application/pdf',
                           'text/plain',
                           'text/rtf');
          $valid = array_merge($this->_permitted, $alsoValid);
        foreach ($types as $type) {
          if (!in_array($type, $valid)) {
            throw new Exception("$type is not a permitted MIME type");
      protected function checkName($name, $overwrite) {
        $nospaces = str_replace(' ', '_', $name);
        if ($nospaces != $name) {
          $this->_renamed = true;
        if (!$overwrite) {
          $existing = scandir($this->_destination);
          if (in_array($nospaces, $existing)) {
            $dot = strrpos($nospaces, '.');
            if ($dot) {
              $base = substr($nospaces, 0, $dot);
              $extension = substr($nospaces, $dot);
            } else {
              $base = $nospaces;
              $extension = '';
            $i = 1;
            do {
              $nospaces = $base . '_' . $i++ . $extension;
            } while (in_array($nospaces, $existing));
            $this->_renamed = true;
        return $nospaces;
      protected function processFile($filename, $error, $size, $type, $tmp_name, $overwrite) {
        $OK = $this->checkError($filename, $error);
        if ($OK) {
          $sizeOK = $this->checkSize($filename, $size);
          $typeOK = $this->checkType($filename, $type);
          if ($sizeOK && $typeOK) {
            $name = $this->checkName($filename, $overwrite);
            $success = move_uploaded_file($tmp_name, $this->_destination . $name);
            if ($success) {
                $message = "$filename uploaded successfully";
                if ($this->_renamed) {
                  $message .= " and renamed $name";
                $this->_messages[] = $message;
            } else {
              $this->_messages[] = "Could not upload $filename";
      public getFilenames() {
        return $this->_filenames;
    ?>
    The error is Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE.   
    I have not worked with oop before and have only very briefly looked at the principle was on my foundation degree.

  • Where to upload images on-line for storyboarding?

    Where to upload images on-line for storyboarding? Or what does it take to produce a storyboard from a Adobe Story Plus Script?
    Any suggestions are welcome ; )

    Hi Richard,
    See if this help article works for you: Adobe Story Help | Storyboards. You can create additional feature requests here: http://adobe.ly/feature_request
    Thanks,
    Kevin

  • Upload images or use direct link to theme directory ?

    Hello,
    I work with APEX 3.2 and Oracle 10g r2, on Windows XP.
    I use my own CSS file, uploaded using Shared Components > Cascading Style Sheets > Create+, I added the link in the header section of the desired templates.
    I want to define an image as "background-image" in my CSS file, but my images were uploaded using Shared Components > Images > Create+, so I have to use #WORKSPACE_IMAGES# but it's impossible in the CSS file !
    Do i have to modify the template directly like that :
    *<div style="background-image:url(#WORKSPACE_IMAGES#header.png)\></div\>*
    or should I use direct links to my theme directory in my CSS file like that :
    *#headerstyle{background-image:url(header.png)}*
    For the moment I use the first solution, both work but I want to know which one is better, for me it would be better to have a separate file with all the CSS, whithout any CSS in the code. Nevertheless I think it's better to upload images instead of store them in the theme directory, no ?
    Thanks.
    Yann.

    Hope it will be fixed in next versions ![It seems unlikely|http://forums.oracle.com/forums/thread.jspa?messageID=3932244]
    If you are making extensive use of CSS, creating custom themes etc and you have access to the web server file system then the best approach is to move all CSS and images there (but using a different directory structure from that supplied by APEX).
    If just making minor customisations, or you are restricted to workspace repository storage, then CSS rules referencing #WORKSPACE_IMAGES# or #APP_IMAGES# need to go into the page HTML Header or page template.

  • N97 - Unable to upload images to Facebook

    Hi, I've been very happy with the recent v2 software update and had no problems so far (after the mess the previous firmware update left my phone in), my only problem is while using the facebook application I can no longer upload images from my phone to facebook.
    It just hangs when I try to do it. I've seen a few threads about but never a solution that works for me. I've tried re-installing the facebook app from Ovi, but this didn't work either. Please can someone help! This is the main feature I use on my phone for saving and backing up my photo's remotely, and as it seems a common problem there must be a solution!
    Thanks.
    1020

    This won't help fix your problem but a better way to upload pictures to Facebook (and other sites) is by using PixelPipe; http://pixelpipe.com/
    It installs setting which use the Nokia upload online feature.  if you set it to default you just take a picture and hit the upload button and voila it will send the picture to PixelPipe then onto whatever sites you have registered.  You can also go into the N97 gallery, choose all the photos you want to upload and the do the same.  It supports routing into specific albums or destination but I've not used this much.  I have my PixelPipe configures to upload to Facebook, Flickr and Ovi all at one.
    Again this won't fix your issue, which I think St3ph3n might have answered best anyhow but it's a much better way to get your photos onto Facebook.
    BR,
    Gavin Nesbitt
    http://geekhouse.dyndns.org

  • Way to limit image size on uploaded images?

    Hello! Is there a way as administrator that you can limit image size for uploaded images? (Like in Contribute) Thanks so much

    Hello mikkiblaes,
    There isn't a way to limit the size of an image that is uploaded in InContext Editing, but there is a built-in file size limitation of 2MB. As the InContext Editing Browser help states:
    Once you've inserted the media element, you can resize the asset by dragging the resize handles around it, or by changing the width and height values in the Media toolbar. (Make sure the asset is selected when you do this.) To maintain width and height proportions when you resize, make sure the lock option is selected. (It's selected by default).
    This type of feature has been requested a couple of times:
    http://forums.adobe.com/message/991229
    http://forums.adobe.com/message/1994111
    And we would greatly appreciate your feedback on how you would envision this working.
    Best regards,
    Corey

  • Using curve 8520 to upload images to facebook

    i am in love with the curve 8520 ease of uploading images to facebook without having to first save the images to pictures
    when i receive an e-mail i can simply send the photo to facebook without having to save it to pictures and when i visit a website using the browser i can simply select full image then send simply send he image to facebook.
    while researching other models with the intention to upgarde i discovered that the torch 9800 and bold 9900 do not have this feature.  what is this feature called ?  it is imperative that tis feature is available in the other models that i am considering upgarding to.  what model has this feature?

    Currently, there is no direct method to upload images programmatically via Adobe Drive. Adobe Drive SDK is used to develop custom connector.
    BTW, InDesgin has a function called package(Menu:File->Package). After you open a file with linked files and click menu File->Package, you specify a folder in Adobe Drive disk(Z:), then all related files will be saved to the specified folder and checked in automatically, no matter the original linked files are checked into the server or not. The disadvantage is that it may break your current folder structure. If the package function can meet your requirement, you can refer InDesign SDK from http://www.adobe.com/devnet/indesign/sdk.html to develop a plugin/extension to do this work.

  • Uploading images from Canon SLR Dig using CF or SD from Powershot camera

    I am are that this is for iPhoto users, but I have no idea where else to post my question so please guide me to the right place.
    I am no intention to use either iPhoto or Aperture to upload my RAW or JPG images from Canon Cameras. I am currently using ZoomBrowser and have all images on Ext HD. However, I'm facing some challenges.
    When I am trying to upload RAW images from CF card using a card reader using Zoom Browser I can only upload one image at a time (can you imagine like using the freeway on a horse). I get a error message but the image gets uploaded. If I try more than one it doesn't work. Also once the image is uploaded it does mark the image as being downloaded.
    When I try the same uploading JPG from a SD using a card reader. It's a very slow and tedius process.
    So what is the deal, do I need to get a card reader compatible with the Mac. Or Apple is making impossible to use a third party to upload images.
    Any suggestion would be appreciate, thank you

    Hi
    Thanks for our suggestions, no I was not aware of Image Capture, as I said I'm very new using a Mac. Basically, my intention is to use a means to upload my images to my destination of choice. One of the main reasons that I don't like iPhoto is because it forces you to upload the images to the HD.
    As far as Aperture would you believe that I bought it almost a yr ago and haven't even bother to open it, it's not user friendly and takes a lot of twiking to change the library to another location.
    BTW the only way that I have been uploading my images is by using a Card Reader. I believe the one for the CF is USB 2 but not sure and for the SD its a USB 2 but get the same reaction.
    All I was trying to find out if the Mac had a way to upload images to any destination w/o using iPhoto and I think you already mentioned it, now all I have to do is to find it
    Thanks again.
    BTW I contacted Canon and they tell me that is not their problem, so now I'm caught in the finger pointed battle too much energy wasted......

  • Upload Images to Kuler

    I really want to be able to use Kuler, but I use it by uploading a logo or image to create the color scheme for a project.  This feature is vital, without it I can just use my other adobe products and don't need to use kuler.

    The new beta version of kuler website includes Upload from image feature . Click the link below to access it.
    https://kuler.adobe.com/features/enable/newFeatures
    Go to http://blogs.adobe.com/creativelayer/adobe-kuler-is-kooler-a-beta-release/   for details.

  • Code wont work when trying to upload image!

    My Code wont work when I try to upload an image to mysql. (Field in mysql is BLOB)
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>insert</title>
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    <?php require_once('Connections/drama_database.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO databaseimage (name, image) VALUES (%s, %s)",
                           GetSQLValueString($_POST['name'], "text"),
                           GetSQLValueString($_POST['image'], "double"));
      mysql_select_db($database_drama_database, $drama_database);
      $Result1 = mysql_query($insertSQL, $drama_database) or die(mysql_error());
    mysql_select_db($database_drama_database, $drama_database);
    $query_image = "SELECT * FROM databaseimage";
    $image = mysql_query($query_image, $drama_database) or die(mysql_error());
    $row_image = mysql_fetch_assoc($image);
    $totalRows_image = mysql_num_rows($image);
    ?>
    </head>
    <body>
    <form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="form1" id="form1">
    Name:  <span id="sprytextfield1">
      <label for="name"></label>
      <input type="text" name="name" id="name" />
      <span class="textfieldRequiredMsg">A value is required.</span></span>
      <p>
        <label for="image"></label>
        <input type="file" name="image" id="image" />
      </p>
      <p>
        <input type="submit" name="Upload" id="Upload" value="Upload" />
      </p>
      <input type="hidden" name="MM_insert" value="form1" />
    </form>
    <script type="text/javascript">
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    </script>
    </body>
    </html>
    <?php
    mysql_free_result($image);
    ?>
    Any help would be very much appreciated!

    OK, that tutorial is different than what I assume you want. I suspect you want the ability to have users upload images and store the metadata of those images in a database, correct? That tutorial only shows how to upload to a specific location so the image can
    be displayed in an iframe.
    Search for "php file upload scripts" to see how to upload to a file system and store the metadata in the database.
    >and no, mostly i have used the dreamweaver features to avoid it as much as possible
    As you are seeing, DW code is very limited in what it can do. It also generates code that is not up to current standards,and is very difficult to work with if you need to modify it. Basically, it's junk. Forget it and learn how to read and write code. There are tons on tutorials on how to get started with PHP.  DW Server behaviors only seem like a time saver in the beginning. In the end, you'll end up wasting more time using them than learning how to code yourself.

  • Application to upload image

    hey i need to write an application to allow user to upload images from their desktop onto the server machine? can anyone tell me how to go about doing it? thanks in advance...

    MyFaces has an upload component . For details see "features" at http://myfaces.sourceforge.net.
    regards, thomas

  • Can not upload image of larger size in jsf

    i had some issues in file uploading. File uploading is working fine in my local machine and when i am using the www.mywebsite.com:8080/fileUpload.jsf
    but i can not upload images by using the following www.mywebsite.com/fileUpload.jsf
    Ie: without the port. I am using windows server and tomcat 5.5.27
    When i am trying to upload a bigger size image i am getting the following error
    I am using jsf(tomahawk)
    09:10:47,315 ERROR MultipartRequestWrapper:? - Exception while uploading file.
    org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. Socket read failed
    at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:384)
    at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268)
    at org.apache.myfaces.webapp.filter.MultipartRequestWrapper.parseRequest(MultipartRequestWrapper.java:85)
    at org.apache.myfaces.webapp.filter.MultipartRequestWrapper.getParameter(MultipartRequestWrapper.java:181)
    at org.apache.myfaces.context.servlet.RequestParameterMap.getAttribute(RequestParameterMap.java:42)
    at org.apache.myfaces.context.servlet.AbstractAttributeMap.get(AbstractAttributeMap.java:91)
    at org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getTreeStructureToRestore(HtmlResponseStateManager.java:159)
    at org.apache.myfaces.application.jsp.JspStateManagerImpl.getSequenceString(JspStateManagerImpl.java:260)
    at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreTreeStructure(JspStateManagerImpl.java:230)
    at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:267)
    at org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView(JspViewHandlerImpl.java:231)
    at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:81)
    at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
    at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:100)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at com.zerone.rrs.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:100)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:444)
    at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:472)
    at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)
    at java.lang.Thread.run(Unknown Source)

    Never mind . problem solved after i restarted

  • Error message "This program cannot display the webpage when uploading images to Cafe Press

    I have had a Café Press shop for five years and except for sometimes being slow, no problems uploading images. Now, suddenly for 3 days I get the message "This program cannot display the webpage
    Most likely causes:
    • You are not connected to the Internet.
    • The website is encountering problems.
    • There might be a typing error in the address.
    What you can try:
    Check your Internet connection. Try visiting another website to make sure you are connected.
    Retype the address."
    I got the messsage about half way through the uploading of an image. People suggested using "firefox" instead of IE so I now get a similar error message from Firefox. I signed in, clicked on the image I wanted to upload and hit "upload" and get message as follows:
    Server not found
    Firefox can't find the server at members.cafepress.com.
    * Check the address for typing errors such as
    ww.example.com instead of
    [url=http://www.example.com]www.example.com[/url]
    * If you are unable to load any pages, check your computer's network connection.
    * If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
    None of this makes sense because I WAS connected to the internet (obviously) or I wouldn't have been able to sign in, go to my media basket, browse for the image and click "upload" and watch as the progress bar showed percentage of upload such as 20%, etc. and even went to 100% at times before giving me the error message. Plus I couldn't make a typing error since I wasn't typing anything but uploading an image. Any suggestions?
    Whatever your suggestion, I need step by step instructions as I am totally computer illiterate. I don't even know what a "proxy" is and don't know if I have a "firewall" as the message suggests. I have "Comodo" security and am using Windows XP.
    I contacted CP which was no help at all. All they did was tell me to clear my cache which I do after every session. Thanks
    Nancy
    http://www.cafepress.com/calendarflr

    Sounds like your desktop application is in fact running from
    a server. CHMs were identified as a security risk by Microsoft and
    are best suited to the user's PC.
    Click
    here for more information.

Maybe you are looking for

  • Invoice Footer printing on every page of invoice instead of first page only

    Hi, I am working on an AR invoice report. I have a RTF template (template is 1 page only) and the output is PDF. The invoice has invoice header ( bill to , pay to ) and invoice line details. On the bottom of the first page of every invoice , I need t

  • Scan as a jpeg

    I have an officejet 6815.  When I scan something it saves it as a PDF and  need it to be a jpeg.  I cant figure out how to change that.  When I scan something,half the time it is so I can manupulate it.  I dont have a program that can alter a PDF.  v

  • Relinking FCPX multicam media

    I did a multicam project in FCPX with the 2 media files temporarily stored on my local harddrive. I had a copy of these exact same files with different filenames on an external hdd. As I updated FCPX to the new library management I wanted to clean up

  • Weblogic.refresh meet exception(Jsp refresh)

              Hi all,           I intend to make my new JSP files in effect immediately,so I used "weblogic.refresh"           utility to implement it. The command line is showed below. I think the call to           weblogic.refresh successful. But from

  • Importing Settings not taking effect

    Under the Importing settings, for "On CD Insert:" the selections I make don't take effect. If I tell it to Import, no luck. If I tell it to Import and Eject, no luck. The settings are retained and show correctly the next time I open Preferences, but