Upload and Resize Image not inserting filename in database

I have a form that I created using the insert record form wizard. One of the fields is a file field and my form enctype is set to multipart/form-data. I then used the upload and resize image behavior and set the parameters. When testing the form the file uploads to the correct directory but no entry is made into the database for that particular field. The other fields are entered into the database just fine. If it helps, here is the code generated before the  tag:
<br />
<br /><?php require_once('../../Connections/test.php'); ?>
<br /><?php<br />// Load the common classes<br />require_once('../../includes/common/KT_common.php');<br /><br />// Load the tNG classes<br />require_once('../../includes/tng/tNG.inc.php');<br /><br />// Make a transaction dispatcher instance<br />$tNGs = new tNG_dispatcher("../../");<br /><br />// Make unified connection variable<br />$conn_test = new KT_connection($test, $database_test);<br /><br />// Start trigger<br />$formValidation = new tNG_FormValidation();<br />$tNGs->prepareValidation($formValidation);<br />// End trigger<br /><br />//start Trigger_ImageUpload trigger<br />//remove this line if you want to edit the code by hand <br />function Trigger_ImageUpload(&$tNG) {<br />  $uploadObj = new tNG_ImageUpload($tNG);<br />  $uploadObj->setFormFieldName("picture");<br />  $uploadObj->setDbFieldName("picture");<br />  $uploadObj->setFolder("../images/");<br />  $uploadObj->setResize("true", 120, 0);<br />  $uploadObj->setMaxSize(1500);<br />  $uploadObj->setAllowedExtensions("gif, jpg, jpe, jpeg, png, bmp");<br />  $uploadObj->setRename("auto");<br />  return $uploadObj->Execute();<br />}<br />//end Trigger_ImageUpload trigger<br /><br />// Make an insert transaction instance<br />$ins_team = new tNG_insert($conn_test);<br />$tNGs->addTransaction($ins_team);<br />// Register triggers<br />$ins_team->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");<br />$ins_team->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);<br />$ins_team->registerTrigger("END", "Trigger_Default_Redirect", 99, "../team.php");<br />$ins_team->registerTrigger("AFTER", "Trigger_ImageUpload", 97);<br />// Add columns<br />$ins_team->setTable("team");<br />$ins_team->addColumn("id", "NUMERIC_TYPE", "POST", "id");<br />$ins_team->addColumn("sort", "NUMERIC_TYPE", "POST", "sort");<br />$ins_team->addColumn("name", "STRING_TYPE", "POST", "name");<br />$ins_team->addColumn("title", "STRING_TYPE", "POST", "title");<br />$ins_team->addColumn("description", "STRING_TYPE", "POST", "description");<br />$ins_team->addColumn("picture", "FILE_TYPE", "FILES", "picture");<br />$ins_team->setPrimaryKey("id", "NUMERIC_TYPE");<br /><br />// Execute all the registered transactions<br />$tNGs->executeTransactions();<br /><br />// Get the transaction recordset<br />$rsteam = $tNGs->getRecordset("team");<br />$row_rsteam = mysql_fetch_assoc($rsteam);<br />$totalRows_rsteam = mysql_num_rows($rsteam);<br />?>

If the reason is about memory, warning message should be happened when upload the image, because "show thumbnail" means resize at second time, how come you failed to resize the picture that system let it upload succeed at the first time by the same resize process?
upload procedure
a.jpg: 2722x1814, 1.2mb
upload condition: fixed width 330px, 1.5mb
"upload and resize" a.jpg -> file upload -> "resize engine" -> passed (but not work and no warning message)
"show thumbnail" a.jpg -> "resize engine" -> failed (not enough memory)
it doesn't make sense.
and you miss an important key point, I upload the same picture myself, and resize work, so I said it happened at random, and that's why I am so worried.

Similar Messages

  • Image Upload and Resize Trigger Order Question

    Hello All,
    I do enjoy and like using the ADDT, however I do have a problem with the Image Upload and Resize trigger.
    I understand that this trigger is of the AFTER type, and as such, the insert record I have on the page is implemented first and the data is inserted into the table, then images uploaded provided they are smaller than 200 kB in size.
    However, as I have a field that is unique in the database, if the upload fails I am unable to upload any files which are under the size and put that information into the database, as there is already a record with the unique value.
    Is there an easy way to work around this by trying to capture the error before the data is inserted into the database?
    An idea I have is to: check the unique field with the value to be inserted, if fails, change unique value -> nothing inserted yet, no files uploaded.
    If the unique check passes, insert remaining data and trigger the upload and resize image trigger, once that is complete, have an update of the table to update with the unique value.
    I can see the above working, (I think), but I just have to write the code to implement the idea.
    I am not sure how to use the roll-back triggers either, if the Upload Image trigger fails, to remove the inserted record.  But if I can manage the roll-back trigger to remove the record, that is an option to consider for what I want to achieve.
    Thanks to any help people can provide.
    Cheers,
    Ian.

    Thank you for your reply.
    I have a work-around, I have split the forms over two pages, rather than put everything on one page - which introduced another issue, to which I have made a work-around of sorts too.
    The two forms, on different pages, is probably a better idea in terms of better management of data input. The work-around was a Header redirect based on a form variable, as, if I used a Custom Trigger to dynamically generate a new URL, it generated an escaped-encoded URL - to which I have not figured out how to fix.
    So, in the meantime, it works, so I will settle for that at the moment.
    Again, thanks for you reply.
    Ian.

  • Upload and resize issue

    Hi,
    I'm having a very strange issue with Upload and resize, using Imagemagik as library. I usually use "Proportional - Fixed with", with the width I need. But the upload page gives me this error:
    Notice: Use of undefined constant height - assumed 'height' in /home/webadmin/mydomain.com/html/includes/common/lib/image/KT_Image.class.php on line 338
    The upload is configured as this:
    function Trigger_ImageUpload(&$tNG) {
    $uploadObj = new tNG_ImageUpload($tNG);
    $uploadObj->setFormFieldName("imagen_pob");
    $uploadObj->setDbFieldName("imagen_pob");
    $uploadObj->setFolder("../poblaciones/");
    $uploadObj->setResize("true", 800, 0);
    $uploadObj->setMaxSize(2500);
    $uploadObj->setAllowedExtensions("gif, jpg, jpe, jpeg, png");
    $uploadObj->setRename("custom");
    $uploadObj->setRenameRule("{id_pob}.{KT_ext}");
    return $uploadObj->Execute();
    Are you having issues with this trigger?
    Thank you,
    Ruben
    Edit: If I use GD the error is this one
    Fatal error: Allowed memory size of 25165824 bytes exhausted (tried to allocate 16432 bytes) in /home/webadmin/mydomain.com/html/includes/common/lib/image/KT_Image.class.php on line 1774
    There is no room for just 16432 bytes?

    Thanks for your reply.
    So if I understand the script works fine on one server (memorylimit 120mB) but not the other (memorylimit 20 or 24 mB)?
    That is the difference. Now I have made a restriction on both the size (kB) and max height/max width. That gives the opportunity to upload images of up to 1.2 mB and maxHeight/Width of 2300 pixels (memorylimit of  20 mB). The figures were found by trial and error.
    Well sounds like a server issue. Is the new server php-cgi or apache mod php?
    I don't know but I will have a look (Probably apache). Out of curiosity- will there be a difference?
    Have you tried making a .htaccess file with php commands to control memory needed?
    Yes and it didn't work - either I have made an error or the host have found out that many people due to still larger imagefiles do their best to bypass these memory limitations
    I am currently looking into som javascripts (FLEX (found one in the ADOBE forum that may be able to do the trick) /FLASH may also be a possibility). Hoping to find a way to resize on the client and upload the reduced image to the host in one go. Many customers requests such a feature.
    Thanks for your help.

  • Upload and display image in webside

    Hello Friends,
    I am developing an auction web site ,and facing some problem so I need your help.
    There is some confusion about uploading and displaying images in website .In web based
    application if I want to upload images than where have to store the images database or server
    side any folder .I have not idea about that please send your ideas and sussesions.
    Second problem is What is the best way to display images in webside either giving a direct
    path of server side image folder or I need to retrieve all images from database .
    I have no idea about it please send me your guideline which are usefull for me to implement in my
    website.
    what is the correct way to upload and display images in website ?
    Thanks . Have a nice day.

    If you are using a Container you just leave your image files in the home directory of your web application. And forget this idea about database. It´s not necessary in this case.
    To display the images just use HTML, <img src="url">.

  • Class to upload and download images

    is there any class which we can use to upload and download images
    only 1 restrain while downloadin it should NOT ask where to download
      it should directly go to desktop.
         please help
    Edited by: Amit Sawant on Dec 20, 2007 10:45 AM

    You have to call the Static methods of the Class: Cl_GUI_FRONTEND_SERVICES.
    for UPLOAD:
    call Method Cl_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    for DOWNLOAD:
    call Method Cl_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
    You can open this Class Cl_GUI_FRONTEND_SERVICES in Class builder SE24 and find these methods
    Also refer to these links:
    cl_gui_frontend_services
    CL_GUI_FRONTEND_SERVICES
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
    Reward points if found helpful...
    Cheers,
    Chandra Sekhar.

  • How to upload and download image?

    hi,
    can anyone send me links  how to to upload and download image to and from sever
    Here i am using amfphp,mysql,php
    i have an button and textfield.when i clicked on the button the path will be stored into database and image will be
    stored into server folder.Similarly for edit i want to display that image to end user.How to do that?

    hi,
    you need to first bring the image into your sap system.
    that you can achieve by right clicking you application and then clicking on create mime object.
    check out this link too:
    Re: how to upload an image file(or any file) in mime using file upload ui eleme
    then you have to insert an image ui element in your view.
    check out the link:
    http://help.sap.com/saphelp_nw04/helpdata/en/f3/1a61a9dc7f2e4199458e964e76b4ba/content.htm
    according to you req i think you need to upload and download the image file in your system using a button. so for this you can follow the below link:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71
    hope this will surely help you!!!
    thanks & regards,
    punit raval.
    Edited by: punit raval on Jun 24, 2009 9:56 AM

  • Export and Import are not supported on 10g databases for users logged

    Hi
    I having the below written error, when i want to export or import my database. I having Standalone system using windows xp.
    Role Error - Export and Import are not supported on 10g databases for users logged in with the SYSDBA role. Logout and login using a different role before trying again.

    Actually i ma new to EM...
    When I want to Import any thing He is asking abt the HOST CREDENTIALS
    I can't undrstatnd wht he is asking????
    Host Credentials
    * Username          
    * Password          
              Save as Preferred Credential
    It Genrate the below error
    Error - ERROR: Wrong password for user

  • Upload and Download images using API

    Hi
    I have an image catalog database where the actual images are stored on the database server filesystem and reduced size images are uploaded into the database. The user can browse and search the image catalog and see the reduced size images.
    I have created a collection to store the filenames of selected images (the user selects the images he likes, much like a shopping cart) and I would like to be able to get the corresponding full size images from the server to the client (which are not stored in the database but have the same filename in a folder in the OS).
    I am using XE so don't have room to store the full size images in the catalog.
    I need this to work at the click of a button on the apex form - say the user does a kind of checkout procedure and the files he needs are delivered to his desktop or memory stick or wherever.
    For this button process is it best to
    1) upload the big images into the database (temporarily) and then download them to the client before deleting them from the database - I can do the multi upload from pl/sql but not sure how to do the download.
    or
    2) write some kind of OS batch file to copy the files from the server to the client
    Any help gratefully received.
    I'm using Apex 3.1 on 10g XE on Windows XP
    Thanks
    Kathryn

    Hi
    I don't think bfiles will solve my problem. I need to get a file from a directory on the server to a user specified directory on the client. The database can't write bfiles to the client PC (security). I don't even need the files to be in the database.
    I'd like my applcation to either
    1) write a batch file and then run it. The contents of the batch file will be the copy commands to copy files form server to client
    or
    2) upload the files from the server directory into the database and then the use can download them to wherever he likes - but I need to do multiple files with just one click of a button by the user and the process needs to do the following steps : upload from server, download to client, delete from database
    I think I can do option 2) using Denes' code but it seems a bit OTT and a lot of database work just to copy some OS files.
    Just wondered if anyone else has done something similar
    Kathryn

  • How to  upload and display image using bsp application

    hi
    I  just wants to know that
    1- how to  upload image from BSP page with attachment into sap server .?
    2-how to display image in to BSP page(webpage).
    thanks

    Hello Gupta Prashant,
    Just to upload and display an image, import image in MIME repository. Not only still images but also flash files can also be uploaded in the MIME repository. Once you import the image in it, use normal html code for image call;
    <img src = "file.jpg/gif" width=  height=>
    Besides it, if your requirement is to store the image in the database and fetch it based on specified field-name, then you have to go for BLOBs i.e Binary Large Object, using this you can also store images, videos, pdfs, applications in the database.
    MBLOB - Medium BLOBs store videos and pdfs,
    LBLOB  - Large BLOBs store movie files and applications.
    You have got 2 ways to use it; some databases store BLOB objects into themselves and some store the path of the BLOB object maintained on the FTP server.
    You can also implement it in ABAP;
    read the following link and practice the tutorial;
    [ Use of MIME Types|http://help.sap.com/saphelp_45b/helpdata/en/f1/b4a6c4df3911d18e080000e8a48612/content.htm]
    also check this
    [TYPES - LOB HANDLE|http://help.sap.com/abapdocu/en/ABAPTYPES_LOB_HANDLE.htm]
    And looking at your question, in order to upload an image, you can make use of FILEUPLOAD tag provided by HTMLB.
    Step 1: FILEUPLOAD provides a browse button to choose desired image file.
    Step 2: Store that image in database using BLOBs.
    Step 3: Retrieve the image using normal select query and display it on the screen.
    Hope it helps you,
    Zahack

  • Where can I find a SIMPLE program to layer and resize images on my Air?

    I've downloaded the GIMP & looked at Seashore, Inkscape, Sketchbook, and Paintbrush. All I want to do is resize images (paintings and drawings, not photos), sharpen the contrast in some of them, and MAYBE layer floral drawings over some text background--the programs I mention having looked at/tried seem far too complex for what I want to do, and I just get lost trying to figure them out (and reading the user manuals!).

    Is this an older "round" version of the AirPort Extreme? If yes, it is true that AirPort Utility 6.x no longer supports the older AirPort Extreme and AirPort Express models.
    A model number......located on the bottom of the Extreme or on the side of the Express would be helpful to confirm what you have.
    Apple probably does want you to buy a new AirPort Extreme.
    The workaround might be to use a Mac or PC running a 5.x version of AirPort Utility.
    A more complicated workaround would be to install AirPort Utility 5.6 on Mountain Lion.  This is not supported by Apple......it does work for me.....but may not work for you. See this article for more details:
    http://www.macworld.com/article/1167965/mountain_lion_and_the_ancient_airport_ba se_station.html

  • Best way to upload and store image file using struts

    Hello there,
    I'm having two choices for uploading image files(not huge image files) using struts a) to store the image in application server's directory
    b) to store the image files as BLOB in database.
    Although each of the image files have to be associated with unique ID to identify the image for re-display.
    Which is the best option. application server's directory or database
    josh

    I think storing it in the application server directory would probably allow for faster access, is easier to code, and doesn't depend on db connectivity.
    As for the unique id, you could probably use the File.createTemporaryFile method--it returns a unique id for every file in a directory, given a prefix & suffix. You just have to remember to change the extension from a .tmp to the image format you're using.
    Anyway, that's my 2 cents.

  • Lightbox next and prev image not showing

    I have a lightbox that was working fine. It works fine when I
    view it on my machine, but as soon as I upload it, the images for
    the next and previous button don't show anymore. Why could this be?
    Seems like the paths are right, since it works locally(they are
    relative).
    Any ideas what I could look at? Kind of at a loss.
    Thanks a lot!

    brian914 posted in macromedia.dreamweaver
    > I have a lightbox that was working fine. It works fine
    when I view
    > it on my machine, but as soon as I upload it, the images
    for the
    > next and previous button don't show anymore. Why could
    this be?
    > Seems like the paths are right, since it works
    locally(they are
    > relative).
    Ref:
    http://www.strivesurfboards.com/pages/boards.html
    http://www.strivesurfboards.com/images/boards_lg/bully_1.jpg
    HTTP/1.x 200 OK
    http://www.strivesurfboards.com/images/blank.gif
    HTTP/1.x 404 Not Found
    http://www.strivesurfboards.com/images/nextlabel.gif
    HTTP/1.x 404 Not Found
    http://www.strivesurfboards.com/images/boards_lg/bully_3.jpg
    HTTP/1.x 200 OK
    http://www.strivesurfboards.com/images/prevlabel.gif
    HTTP/1.x 404 Not Found
    Do you see a pattern here?
    Mark "404" Boyd
    Keep-On-Learnin' :)

  • Crop and resize images on iPhone - app recommendations?

    Does anyone know of a photo-editing app for iPhone that lets you crop an image and also resize to a preferred pixel ratio?
    On my Mac at home I use Photoshop for this (setting the crop-to width at 500 px and then simply cropping the part of the image I want to use), but it would be super-handy if I could load the high-res images onto my iPhone and do it on the move.
    I tried the Photoshop app, but although it lets you crop, there doesn't seem to be a resize function.
    Any ideas?

    Hi Jennifer, I guess It's not possible do what I want directly from iPhone.
    My problem is pinch to small size and keep it then and send to Instagram. When I double tap the image enlarge, so I double tap again and the image go back to normal size. When I pinch to small size that I want and leave my fingers the image goes back to regular size.
    I'm reading others foruns and I guess I have to use some app to post 3:4 photo, like Squaready. I'm trying and seems It work. It need to resize and crop and make all adjustments.
    Thanks for help.

  • UPLOAD AND SHOW IMAGES

    I WANT TO SHOW THE LOGOTYPE OF MY COMPANY IN THE PAGES AND RAISE THE IMAGE, SOON I PUBLISH THE APPLICATION ADDING THE IMAGE LIKE LOGOTYPE, BUT IT DOES NOT SHOW IT. THAT IT LACKS TO DO.
    WATH I MUST DO?
    Message was edited by:
    user562274

    I use my logo in my applications - I have to upload the logo image and reference it in the application definition page. (easier than template changes)
    TO Upload the image, go to ....SHARED COMPONENTS...> IMAGES...> CREATE button.. fill in UPLOAD window with application, browse for your image, then click UPLOAD
    THEN ...in your application (on the page that shows all your application pages)... Click on EDIT ATTRIBUTES... Click on DEFINITION... either scroll down LOGO or click on Logo tab in tabs going across your page)
    IN LOGO Section assuming you uploaded image "mylogo.gif":
    Logotype IMAGE radio button should be checked on
    ImageType should be either:
    #APP_IMAGES#mylogo.gif
    OR
    #WORKSPACE_IMAGES#mylogo.gif
    The difference is when you uploaded the image - did you associate it with this application or leave it available for all applications in your workspace?
    I don't have my logo attributes supplied and it works just fine but this would be where you would put height and width attributes.

  • Can I use iPhoto to view and edit images not stored in the iPhoto Library

    Hi folks,
    I'm a newbie to Mac after 20+ years on PC...just switched 2 weeks ago....wish I'd done it years ago. Everythings so easy and fast...e.g. setup wireless broadband in 25 mins with no probs....and I have never done anything like that.
    Here's my Q.
    I have a load of images, downloads and scans, of old manuscripts, authors etc. which I don't really want in my iPhoto library (which I would like to keep for actual photos. Is it possible to point iPhoto to another location (say in Documents) where it will let me view and edit these images without importing them into the library.
    Alternatively can I view images as thumbnails in this other locations, and not as default file type icons.
    Hope this is plain,
    JP_MAC
    Imac G5 17" 1.9Ghz   Mac OS X (10.4.3)  

    Hi jp-mac,
    iPhoto 5 imports all images into it's own database. (this has changed with iPhoto 6 so you might want to check out iLife 6)
    The other files you want to view but not have in the library...are they image files?
    If so, you can view that folder as icons and then make the icons larger so you can see what they are.
    To do this open the folder in question. click the first icon on top of View in the toolbar. This will make that folder contents view as icons
    Now go all the way to the top of your screen and click on View>show view options.
    Slide the icon size slider all the way to the right to view them larger. Also make sure you have the "show icon preview" checked.
    This will work most of the time, but sometimes if you edit images in other applications they might not make icon previews, so check their preferences to make sure you have that checked.
    There is also a little third party program that will do it for you.
    One is called Pic2Icon
    Pic2Icon
    Another one is a contextual menu item called QuickImageCM.
    QuickImageCM
    check out that page because there are some other useful contextual menu items that I use all the time.

Maybe you are looking for

  • What is the oldest PS file type that can be opened in CS5?

    I have a lot of work that was created in PS 7.0. I want to get the latest version. What is the oldest file type that can be opened in CS5?

  • New Safari interrupts my typing in address bar

    For the last 10 years I haven't had this problem at all, but with the new version of Safari I am. Basically if I open a new tab or something and start typing in the address bar, before I get finished typing, it will stop my typing and take me out of

  • Debit / credit entry

    Dear All,              When we create a debit / credit entry for vendor with reference to a P.O. due to some price difference in P.O. & bill of vendor,the amount which pass thru debit / credit entry will load on material price. if yes then please giv

  • My site keeps going down

    I run my blog (http://blog.gauffin.org) in your wordpress template (paid subscription). I get this error now and then: The page cannot be displayed because an internal server error has occurred. Remote Address:94.245.104.73:80 Request URL:http://blog

  • Browser invoke event startup order

    Hi. We have an application that gets installed with badge and also configured over badge. The badge sends some arguments with the instalation and the application generates its config file if it does not exist. This worked great, but now we had to mak