Delete an uploaded image

Hi
Can anyone give me instructions for deleting an uploaded image without deleting the whole record? For example, I have a record with an uploaded image, the image name stored in the table and the image in a directory. I change my mind and want no image associated with the record. How do I delete the image associated with the record and make that image name field null?
Thanks

OK, I have it working in a round about way. I'm sure with Gunters help I could get it going the 'proper way" but for now this solution seems to be working.
on my detail list I added a link "remove current file" which only shows on the conditional region "show if file exists" so if there is no file this link will not show.. so far so good.
I think pass the URL parameter to a page which I'm filter by URL ID parameted called "deletefile.php"
I then added an update record form and only included the field that is storing the filename. In the wizard I inserted the field as a hidden field. I added a second hidden field and called it "null" and left the value for it blank.
In the update record behaviour you can choose to get the values from any form element in the form area. So I chose to get the values from the hiidden object "null".
when you submit form it will then put the field for the file back to "null'
I'm sure i can get the form to delete the file as well. I'll work on that next.
This does seem a little dirty but seems to be working perfectly fine.
Hope this helps anyone.

Similar Messages

  • 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.

  • Picture Library : upload image with same name overwrite the image in thumbmail or WebVersion view but not the actual image link points to the old image

    Hello,
    I am facing a wired issue with Picture Libraries in SharePoint.
    We created a custom field and added it to UserInfo list, the column based on custom field lets user upload their personal images to a Picture Library with the name <User ID>.<Image Extension> e.g. 1.jpg where UserID is internal Listitem ID of the UserInfo list and set its URL to the field value which we use to display the image on our custom user profile and some other WebParts.
    If the user uploads a different image, it will overwrite the existing one it keeping the same name.
    The field worked perfectly with sites using widows Based authentication, but as we move the field to sites with form based authentication we find that the field is able to upload the image properly first time but on each successive upload, although a new image gets uploaded with the name userid.imagextension and is shown in the allitems.aspx page in the thumbnail view and in the picture preview on the dispform.aspx page, but the link next to the name field and the image shown on clicking the preview points to the old image.
    To put it other way
    https://<Web URL>/Picture%20Library/_w/Upload_jpg.jpg
    https://<Web Url>/Picture%20Library/_t/Upload_jpg.jpg
    Would show the updated image
    but the actual URL
    https://<Web Url>/Picture%20Library/Upload.jpg 
    points to the old image
    what’s even more strange is that even after deleting the image the url still shows the old image at
    https://<Web Url>/Picture%20Library/Upload.jpg 
    I confirmed the same by actually repeating the same exercise on a picture Library in the User Interface
    Uploading an image say upload.jpeg in the picture library using SharePoint interface.
    Then uploading a different jpeg image keeping the same name upload.jpeg again in the picture library.
    In allitems.aspx thumbnail view and on dispform.aspx page preview filed image now show the newly uploaded image but when you click the preview image or click the link in the name field value it takes you back to the old image.
    I have seen this issue on environment where we have enabled form based authentication and the issue is not seen on another server where we have wss with windows based authentication.
    Has anyone noticed such behavior and is there any workaround to that!
    Thanks & Regards
    Saurabh Rustagi

    All,
    I had the same issue. 
    In my case, Blob Cache was enabled for the web application in which the image issue was occuring.
    I cleared blob cache, and after doing a hard refresh of my browser, the correct image was then displayed.
    To clear blob cache, do the following:
    Navigate to:   
    http://yourwebapp:port/yoursite/_layouts/objectcachesettings.aspx
    Select:  "Object Cache Flush"  and  "Force all servers in the farm to flush their object cache" check boxes
    Click the OK button
    Hope this helps.

  • Upload image from server in jdev release2 11.1.2.4.0?????

    HI i am using jdev 11.1.2.4.0
    my requirments are
    1.upload image from server
    2.display image and edited by using editor page like paint.
    3.save that edited copy also
    i am new i jdev,is this requirements are done by jdev,please help,i dont have any idea,please help????

    Unfortunately upgrading to 10.8.2 messes up your previously configured steps and you can no longer rely on Java Preferences to define your JDK setup.
    What I suggest is doing this:
    1) Delete your current JDev installation + the system directory
    2) Ensure that the symbolic link as described in step 3 of the following link is still present and points to actual file
    3) Follow the steps in this blog: https://blogs.oracle.com/blueberry/entry/how_to_saddle_your_mountain ... to reinstall JDev.
    This should get you back up and running.
    CM.

  • I previously uploaded images onto my desktop to work on in Lightroom 5.2. I worked on a few of the images days ago and just now getting back to them. My problem is I can only access the images I previously worked on and all the rest it says images not ava

    I previously uploaded images onto my desktop to work on in Lightroom 5.2. I worked on a few of the images days ago and just now getting back to them. My problem is I can only access the images I previously worked on and all the rest it says images not available but all the images are still right on my desktop.

    ... and all the rest it says images not available
    Normally this happens because you moved, renamed or deleted these photos (or the folders that contain them) outside of Lightroom. This is how to fix the problem: Adobe Lightroom - Find moved or missing files and folders

  • How to upload image in mime repository

    i want a report to upload  image in mime repository.
    , i want a report to delete the image (every week) from mime repository
    and how to get the url of that image ....
    Regards
    Anbu B

    Hi,
    Hope the following Threads will help you regarding your problem.
    How to upload an image to mime repository to display in alv grid with objec
    Thanks.
    Nitesh

  • Wordpress http error while uploading images with flash

    Hi guys
    I have a problem with my wordpress blog " bollywood wallpapers ". When I try to upload images with defualt wordpress flash uploader I get "http" error.
    I am having this problem from last 5 months.

    Dear Siva,
    that is indeed strange.
    Still don't know if this could be an issue with your NWDS or the PAR itself.
    So let's do 2 tests
    ===============================================
    TEST NR. 1
    Let's try and check the NWDS first by creating a custom PAR.
    Don't worry, it's easy.
    Just open your NWDS and go to the top menu
    File > New > Project
    Inside the popup window that will open please choose
    Portal Application (on the left) and Create a Portal Application Project (on the right)
    Then give any name you would like (no spaces or dots, etc...)
    You now have a Portal project created on NWDS ( you will see a folder on the left side with your project name)
    Click on that folder with your LEFT mouse button and choose EXPORT
    Choose PAR File
    Choose your Project
    Choose a path where you want your PAR file to be saved. (uncheck the deploy PAR file, but check the include the source code).
    And click Finish.
    Now delete the project you have created (by clicking on the folder with your LEFT mouse button again, but chose DELETE project)
    Now you're ready to re-import the PAR file.
    ===============================================
    TEST NR. 2
    Maybe your standard PAR file that you've downloaded doesn't have the source code included or is corrupted.
    Please try to open it with a ZIP program and check what type of structure/files you have there.
    Have you also checked your NWDS log ?
    You could also share here that log, so that I can better help you.
    Kindest Regards
    /Ricardo

  • What's the best way to upload images to Blogger?

    My mom is an illustrator and has a very active blog for her work (updates daily). She needs to be able to upload images and publish posts from her ipad, because it's her only portable device. We've figured out that she can do it by uploading the images to photobucket, but it would be nice if there was another way that is less roundabout.
    We are talking about three different sources of images: images created right on the iPad using Brushes 3 (or similar drawing/art apps if she decides to try those), artwork created on paper with pencils and inks that she has scanned at home and needs to take along so she can publish them on the road, and pen and ink images that she photographs with the ipad instead of scanning them (because she made them on the road and there's no scanner to be had). The blog is on Blogger and the iPad is the latest one (the New iPad aka iPad 3).
    If you can help out with that, I'll be grateful because it's been a bit of a headache! And I'll see if I can convince her to make something for the winning answer
    thanks!

    Oh, wow.  I have exactly the same problem of LR not assigning keywords to all my selected images.
    I will try the grid, select the grid and not the filmstrip, and look for the current image metadata checkbox as well.
    BTW, Adobe told me to delete the preferences file, which I did.
    They told me to optomize the catalog, which I did.
    And, lastly they told me to create a new catalog and import all the data from my old catalog, which I did not do.
    Stand by ...
    Wow, that is it.  You folks solved my problem.
    Library Mode, select in the grid OR filmstrip (yep-but harder to see in the filmstrip anyway),
    COULD NOT FIND-look for the current image metadata checkbox as well.
    Michael

  • 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.

  • Simple upload image to amazon S3 winjs for windows phone 8.1?

    Hi
    Can behind simple upload image to amazon S3 winjs for windows phone 8.1?Thank

    Yes.
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • Problem when trying to rename uploaded images using session value

    Hi,
    I have a form where 9 images are uploaded made into thumb nail size and then stored in a file. What I´m trying to do is rename those thumbnails from their original name to username_0, username_1, username_2 etc for each of the 9 thumbs. The username comes from the registration form on the same page. I have created a session variable for the username and am trying to use that to change to name of the image name, whilst my images are uploading and resizing the name stays as the original and not as the new username_$number. I have pasted relevant code below and would very much appreciate any help with this:
    <?php session_start();
    // check that form has been submitted and that name is not empty and has no errors
    if ($_POST && !empty($_POST['directusername'])) {
    // set session variable
    $_SESSION['directusername'] = $_POST['directusername'];
    // define a constant for the maximum upload size
    define ('MAX_FILE_SIZE', 5120000); 
    if (array_key_exists('upload', $_POST)) {
    // define constant for upload folder
    define('UPLOAD_DIR', 'J:/xampp/htdocs/propertypages/uploads/');
    // convert the maximum size to KB
    $max = number_format(MAX_FILE_SIZE/1024, 1).'KB';
    // create an array of permitted MIME types
    $permitted = array('image/gif','image/jpeg','image/pjpeg','image/png');
    foreach ($_FILES['photo']['name'] as $number => $file) {
    // replace any spaces in the filename with underscores
    $file = str_replace(' ', '_', $file);
    // begin by assuming the file is unacceptable
    $sizeOK = false;
    $typeOK = false;
    // check that file is within the permitted size
    if ($_FILES['photo']['size'] [$number] > 0 && $_FILES['photo']['size'] [$number] <= MAX_FILE_SIZE) {
    $sizeOK = true;
    // check that file is of a permitted MIME type
    foreach ($permitted as $type) {
    if ($type == $_FILES['photo']['type'] [$number]) {
    $typeOK = true;
    break;
    if ($sizeOK && $typeOK) {
    switch($_FILES['photo']['error'] [$number]) {
    case 0:
    include('Includes/create_thumbs.inc.php');
    break;
    case 3:
    $result[] = "Error uploading $file. Please try again.";
    default:
    $result[] = "System error uploading $file. Please contact us for further assistance.";
    elseif ($_FILES['photo']['error'] [$number] == 4) {
    $result[] = 'No file selected';
    else {
    $result[] = "$file cannot be uploaded. Maximum size: $max. Acceptable file types: gif, jpg, png.";
    ................CODE BELOW IS THE INCLUDES FILE THAT MAKES AND TRIES TO RENAME THE THUMBS................................................
    <?php
    // define constants
    define('THUMBS_DIR', 'J:/xampp/htdocs/propertypages/uploads/thumbs/');
    define('MAX_WIDTH_THB', 75);
    define('MAX_HEIGHT_THB', 75);
    set_time_limit(600);
    // process the uploaded image
    if (is_uploaded_file($_FILES['photo']['tmp_name'][$number] )) {
    $original = $_FILES['photo']['tmp_name'][$number] ;
    // begin by getting the details of the original
    list($width, $height, $type) = getimagesize($original);
    // check that original image is big enough
    if ($width < 270 || $height < 270) {
    $result[] = 'Image dimensions are too small, a minimum image of 270 by 270 is required';
    else { // crop image to a square before resizing to thumb
    if ($width > $height) {
    $x = ceil(($width - $height) / 2);
    $width = $height;
    $y = 0;
    else if($height > $width) {
    $y = ceil(($height - $width) / 2);
    $height = $width;
    $x = 0;
    // calculate the scaling ratio
    if ($width <= MAX_WIDTH_THB && $height <= MAX_HEIGHT_THB) {
    $ratio = 1;
    elseif ($width > $height) {
    $ratio = MAX_WIDTH_THB/$width;
    else {
    $ratio = MAX_HEIGHT_THB/$height;
    if (isset($_SESSION['directusername'])) {
    $username = $_SESSION['directusername'];
    // strip the extension off the image filename
    $imagetypes = array('/\.gif$/', '/\.jpg$/', '/\.jpeg$/', '/\.png$/');
    $name = preg_replace($imagetypes, '', basename($_FILES['photo']['name'][$number]));
    // change the images names to the user name _ the photo number
    $newname = str_replace ('name', '$username_$number', $name);
    // create an image resource for the original
    switch($type) {
    case 1:
    $source = @ imagecreatefromgif($original);
    if (!$source) {
    $result = 'Cannot process GIF files. Please use JPEG or PNG.';
    break;
    case 2:
    $source = imagecreatefromjpeg($original);
    break;
    case 3:
    $source = imagecreatefrompng($original);
    break;
    default:
    $source = NULL;
    $result = 'Cannot identify file type.';
    // make sure the image resource is OK
    if (!$source) {
    $result = 'Problem uploading image, please try again or contact us for further assistance';
    else {
    // calculate the dimensions of the thumbnail
    $thumb_width = round($width * $ratio);
    $thumb_height = round($height * $ratio);
    // create an image resource for the thumbnail
    $thumb = imagecreatetruecolor($thumb_width, $thumb_height);
    // create the resized copy
    imagecopyresampled($thumb, $source, 0, 0, $x, $y, $thumb_width, $thumb_height, $width, $height);
    // save the resized copy
    switch($type) {
    case 1:
    if (function_exists('imagegif'))  {
    $success[] = imagegif($thumb, THUMBS_DIR.$newname.'.gif');
    $photoname = $newname.'.gif';
    else {
    $success[] = imagejpeg($thumb, THUMBS_DIR.$newname.'.jpg',50);
    $photoname = $newname.'.jpg';
    break;
    case 2:
    $success[] = imagejpeg($thumb, THUMBS_DIR.$newname.'.jpg', 100);
    $photoname = $newname.'.jpg';
    break;
    case 3:
    $success[] = imagepng($thumb, THUMBS_DIR.$newname.'.png');
    $photoname = $newname.'.png';
    if ($success) {
    $result[] = "Upload sucessful";
    else {
    $result[] = 'Problem uploading image, please try again or contact us for further assistance';
    // remove the image resources from memory
    imagedestroy($source);
    imagedestroy($thumb);
    ?>
    I hope i´ve supplied enough information and look forward to receiving any help or advise in this matter.

    Use double quotes here:
    $newname = str_replace ('name', '$username_$number', $name);
    Change it to this:
    $newname = str_replace ('name', "$username_$number", $name);

  • "file does not exist on remote server" when uploading image

    As the title says, when uploading an image im getting the
    message "file does not exist on remote server"......yet dreamwever
    has uploaded the file, its there. All other pages on my website
    work fine when uploading images. Any ideas?

    What image type is it? Is it in an images folder or the root
    directory? It would be helpful to post a link.

  • To Delete the uploaded file in Application Server

    Hi Friends,
    I developed an BSP Application displaying the results from ITAB though Iterator, for which , each row there is feature to upload a particular file in the Application Server, where I stored the file  path into a database table field.  .When I delete the the row, I am successfully get rid of the entire row including the file path.
    My Question.
    1. How to delete the uploaded file of the Application Server ?
    Please mail me in this regard.
    Regards
    CSM Reddy

    Hi,
    you have the keyword and you have the documentation. What is your problem?
    Search in the forums with keyword "delete dataset", there are lots of threads about this.
    Example
    Deletion of dataset in applicaiton server
    deleting file from AL11 Tcode
    Best regards
    Renald

  • How to display uploaded image in jsp page.

    Hello,
    I am using struts 1.2.9 and and have uploaded image on the server. Now what I want to do display the image in jsp page after clicking on one link in jsp. I have tried many thing to display image in jsp page. But I am getting an error during displaying image in jsp. I have displayed absolute path in servlet. and used InputStream and outputstream to display image in jsp page.
    Can any one help.
    Thanks in advance
    Manveer Singh

    Follow this. This topic is very popular recently on the forum.

Maybe you are looking for

  • IMovie project is visible in finder but won't open

    This morning I created a new project and had it just where I wanted it. I closed iMovie and came back later but it doesn't show in the project window. I can see it in finder but when I click to open iMovie doesn't open it. Any clues would be apprecia

  • Problems with Ñ and accents while editing flash template

    Hello Please, someone help! I have been trying to edit the text of a flash template and when i publish it, i cant see the Ñ and the accents i have been looking for a solution and i have found over the internet: system.useCodepage = true; But that doe

  • Hi,can someone teach me how to use save command in netbeans 6.7 ME

    hi,can anyone teach me how to save every information i stored on a form1,like datefield, textfield,and saving it in another form2, is there a code for that?, and showing in form2 the saved information,is it possible? and how in visualMidlet. tnx

  • How to wipe blackberry data if stolen?

    How to erase all the blackberry data if stolen? my blackberry has been stolen when I was travelling in foreign country then the stealer send hoax to all contacts. They told all contact if I sick and need money to do urgent operation >.< is there any

  • Can't eject a phantom remote disc?

    I have discovered, in Finder, a phantom remote disc.  It was a link to an Ibook with a name.  Since I have been researching it, the name has disappeared.  I have attempted to eject it.  How do I get rid of it and what damage has it likely done?