Limit the filesize upload and resize a blob image in a report

I'd like to know how to do both.. I have a file browse that uploads images to my application. It's called P34_IMG1. I would like to limit the file dimensions to a maximum of 200 x 300 px (but it can be less) and have a limit of 1MB in filesize.
As well as the above, I'd like to know how to resize this image into a 'thumbnail' of sorts that shows the image much smaller in a report. The image shows but they are too big. How do I resize them?
Thanks much
-J

oh I didn't see this reply, Tony. Sorry.
No I don't have the image like that in the report, the report's query is like this:
select * from (
select      "LOTS"."LOTID" as "LOTID",
      "LOTS"."LOTNAME" as "LOTNAME",
      "LOTS"."ADD1" as "ADD1",
      "LOTS"."ADD2" as "ADD2",
      "LOTS"."ADD3" as "ADD3",
      "LOTS"."COUNTRY" as "COUNTRY",
      "LOTS"."MESSAGE" as "MESSAGE",
      "LOTS"."APPSTATUS" as "APPSTATUS",
      "LOTS"."SENDERMESSAGE" as "SENDERMESSAGE",
      "USERS"."USERNAME" as "USERNAME",
         dbms_lob.getlength("IMG1") as "IMG1"
from      "USERS" "USERS",
      "LOTS" "LOTS"
where   "LOTS"."USERID"="USERS"."USERID" AND (UPPER("USERS"."USERNAME") = UPPER (:APP_USER)))
where (
instr(upper("APPSTATUS"),upper(nvl(:P40_SEARCH,"APPSTATUS"))) > 0
)and the IMG1 column in the report attributes has the number/date format as IMAGE:LOTS:IMG1:LOTID::::::inline:Download. So I don't know how to use this to resize the images, unfortunately.

Similar Messages

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

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

  • The file upload and download

    Hi all,
    I am going to build a form and run on the web. I am going to do a form which intend to do the file upload and download (any type of file). How can I achieve it?
    Also, once I put it on the web, I would like to do a 'web-like' function: when the user click on the file name, it can open it with the association with the browser (For instance, when I click on the *.doc file, it opens the word automatically). Is it poosible to do so and how to do so? Thanks first.
    Patrick

    Go to Utilities>more Utilities>upload/download is there.
    Amresh.

  • I have accidentially added a video to the photostream upload and now it will not work

    I have accidentially added a video to the photostream upload and now it will not work, it would not let me delete the video from the upload file, so I have uninstalled icloud from PC and deleted all the folders. And started again, but still not working

    You supply little pertinent about the MBP and the iPhone.
    First... on the MBP... Click on the Apple icon.. Top left in Finder...
     > About this Mac > Version...what does it say?
    Which iPhone and what is its' iOS Version.

  • In Lightroom 3 I am in Library mode in the Grid View and need to rearrange images, but it is not allowing me to move them.

    In Lightroom 3 I am in Library mode in the Grid View and need to rearrange images, but it is not allowing me to move them.

    I don't do a lot of dragging to custom arrange my images. But the custom order is right at the bottom of the list of sort orders on my computer.
    Added later: But don't worry about the custom order. It doesn't make any difference on my system. Are you sure you are dragging the image itself, and not the border around the image?

  • Save the Overlay Figures and Text in an Image File in cvi

    is possible have an examples "Save the Overlay Figures and Text in an Image
    File"
    thanks
    nicola mirasole

    Nicola,
    I am sorry but we do not have an example for "Save the Overlay Figures and Text in an Image File" for CVI. Currently, you are going to need to use Window's API calls in order to get this functionality.
    Regards,
    Mike

  • My Ipad has frozen after updating, it has the itunes emblem and a usb cord image on the screem, what do I have to do to get it working again?

    My Ipad has frozen after updating, it has the itunes emblem and a usb cord image on the screen, what do I have to do to get it working again?

    You need to start the latest version of itunes on your computer and connect your iPad in order to restore it.

  • How to upload and download in BLOB?

    I tried webutil but is not working properly according to my needs is there any other way to upload and download files in BLOB?
    If any body knows solution please tell me.
    Regards,

    Dear Colleague,
    In my Forms application, I use the WEBUTIL to load files into a BLOB column. However, prior to getting WEBUTIL to work, I loaded files into the BLOB column using the following PL/SQL code.
    Note, that the example assumes that the row already exists in the table and you are updating it by loading the file into the BLOB. You will also be required to first create a Database Directory object (in my case, it was called "RKMS_DOC_DIR")
    I do not have an example for downloading, as I use the WEBUTIL functionality for this.
    Good luck!
    Randy
    PL/SQL (DBMS_LOB Package): Loading an Internal Persistent BLOB
    with BFILE Data
    The following example illustrates:
    How to use LOADBLOBFROMFILE to load the entire file without getting its length first.
    How to use the return value of the offsets to calculate the actual amount loaded.
    DECLARE
    src_loc BFILE := bfilename('RKMS_DOC_DIR','ROPE_Offerte_v2.pdf') ;
    v_author VARCHAR2(10) := 'RKMS_MGR' ;
    dst_loc BLOB;
    src_offset NUMBER := 1;
    dst_offset NUMBER := 1;
    src_osin NUMBER;
    dst_osin NUMBER;
    bytes_rd NUMBER;
    bytes_wt NUMBER;
    BEGIN
    -- SELECT ad_composite INTO dst_loc FROM Print_media
    -- WHERE product_id=3106 and ad_id=13001 FOR UPDATE;
    SELECT doc INTO dst_loc FROM docs
    WHERE USER_AUTHOR_ID = v_author FOR UPDATE;
    /* Opening the source BFILE is mandatory */
    dbms_lob.fileopen(src_loc, dbms_lob.file_readonly);
    /* Opening the LOB is optional */
    dbms_lob.OPEN(dst_loc, dbms_lob.lob_readwrite);
    /* Save the input source/destination offsets */
    src_osin := src_offset;
    dst_osin := dst_offset;
    /* Use LOBMAXSIZE to indicate loading the entire BFILE */
    dbms_lob.LOADBLOBFROMFILE(dst_loc, src_loc, dbms_lob.lobmaxsize, src_offset, dst_offset) ;
    /* Closing the LOB is mandatory if you have opened it */
    dbms_lob.close(dst_loc);
    dbms_lob.filecloseall();
    COMMIT;
    /* Use the src_offset returned to calculate the actual amount read from the BFILE */
    bytes_rd := src_offset - src_osin;
    dbms_output.put_line(' Number of bytes read from the BFILE ' || bytes_rd ) ;
    /* Use the dst_offset returned to calculate the actual amount written to the BLOB */
    bytes_wt := dst_offset - dst_osin;
    dbms_output.put_line(' Number of bytes written to the BLOB ' || bytes_wt ) ;
    /* If there is no exception the number of bytes read should equal to the number of bytes written */
    END ;
    /

  • My RAZR MAXX HD wont take the latest upload and my APs all crash

    My RAZR MAXX HD keeps failing on the latest upload..and now my APs all crash...any suggestions?  I already have tried the factory reset and it keeps happening...my contract isnt up until march and local store says i cant get a new phone until march....any suggestions

        Help is right here, front and center WadeB1450. May I ask when you completed the factory reset, did you restore all of your app and info on the device? If so then please check to see how much available device memory is available. We suggest have at least 3GB  available. Also, are you doing the update using cellular data or wifi? If you can provide us with this info along with your current software version then we can look into this for you.
    Thank you…
    ArnettH_VZW
    Follow us on Twitter @VZWSupport

  • I uploaded and edited my RAW image, clicked 'Save As', and changed the file type from .psed to .jpg.

    I edited my raw image in Photoshop CS6, selected 'Save As', and changed the file type from .psed to .jpg. I also selected 12 and large file when the window popped up, concluding my 'saving as'. My computer does not recognize the file type and won't open them. Can someone help me? Thanks!

    When naming files, stick to the letters of the ENGLISH alphabet, numbers and underscores.  Do not use illegal characters like apostrophes, commas, asterisks, ampersands, hatch or pound signs, diacritics or accented characters, slashes, etc.
    While the period (dot) is not an illegal character per se, your file names should have only one period and that should always be followed by the file type extension.
    EDITED typo: se
    Message was edited by: station_two

  • I need to display my Blob image in my report (and also on form page)

    Scott,
    I followed the APEX advanced tutorial for uploading and downloading files. I have created a form on a table and that table contains a column of datatype BLOB. Now I want to be able to display the (Blob) images that I have uploaded.
    As I research the topic, I get the feeling that displaying the BLOB image can only be done in APEX 3.1 and up. Is this true? I have that version of APEX installed on my laptop and have successfully completed the "Defining and Viewing BLOB Data in Oracle Application Express 3.1" tutorial found here: http://www.oracle.com/technology/obe/apex/apex31nf/apex31blob.htm
    But I could not do it on the company server that runs APEX 3.0
    Even if I did get the approval to have the company APEX application upgraded to 3.1, there still is the issue of scaling the images so that they are not so large. I understand that there is a UTIL.APEX function "GET_BLOB_FILE_SRC" that would do this for me. I read the documentation at:
    http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/api.htm#CHDICGDA
    After reading it, I was still not clear as to how to use it correctly. Is there any documentation on how to implement this function in APEX?
    I did find something that I was hoping would help me. The article is entitled "Show Blob of other table in APEX Form" by Dimitri Gielis can be found here: http://dgielis.blogspot.com/2008/07/show-blob-of-other-table-in-apex-form.html
    I tried to import the file "blob_support.sql" application (on both APEX 3.0 and APEX 3.1 systems) but got errors. I'm not having very much luck here and would appreciate the help in pointing me in the correct direction.
    Help!!
    Thanks
    LEH

    Hello John,
    Your information was helpful. I can now see my images in my form.
    OK, now I would like to be able to call the image using a Region Source of type SQL instead of the HTML Expression. The reason for this is because I need to use logic to determine if the file is an image or not and to determine wether to show a thumbnail or just a link. I did find a "GET_BLOB_FILE_SRC" Function on the internet that suggests that I could do this but I need some help in making it work in my application.
    Here it is as a Region Source of type SQL:
    SELECT ID,
    NAME,
    CASE WHEN NVL(dbms_lob.getlength(document),0) = 0
    THEN NULL
    ELSE CASE WHEN attach_mimetype like 'image%'
    THEN '<img
    src="'||apex_util.get_blob_file_src('P4_DOCUMENT',id)||'" />'
    ELSE '<a
    href="'||apex_util.get_blob_file_src('P4_DOCUMENT',id)||'">Download</a>'
    end
    END new_img
    FROM TEST_WITH_BLOB
    If anyone can help me with this that would be appreciated.
    Thanks
    LEH

  • Limit the number of record to download to excel from a report

    I am just wondering if there is a way to limit the number of rows that I want to download to excel from a report in apex, right now when I click download to excel it downloads all records. If I am displaying 15 records on report page I want the ability to download only those records.
    Any help with that would be appreciated.
    Kind Regards,
    Sofia.

    Sofia,
    The same report query runs for downloading the data into excel, I don't think you can limit the number of records in download.
    You can achieve it using custom code, like on click of download excel redirect to another page and then restrict the data as per your need, or you can use the custom procedure to download the limited data.
    Denes' utility to download into excel.
    http://htmldb.oracle.com/pls/otn/f?p=31517:108:1476564836494581:::RP,::
    Regards,
    Manish

  • Resize and print a large image in a report

    A current project I'm working requires that a "report" be printed out for every "part" produced.  
    Each "part" is photographed and a high quality (large) .jpg file is
    generated and cataloged on the hard drive.  A report with this
    image is then printed and shipped with the product as part of a QA
    process.  
    Initially I used a command line argument to have Irfanview print the
    image only.  This was so easy.  Even printing in Landscape
    was simple.  Of course then I realized I would probably need a
    little more information than just the image.  
    Looking at some examples of report generation and reading some of the
    problems others have had in the past, I figured it might be good to ask
    before I go stumbling around in the dark.  
    The original images are 2288x1712 in size.
    Is there any way to auto resize an image to "fit" onto a printed report?  
    The only way I can think to do is to experiment with different sizes
    until I find something that fits and looks alright, then use either
    IMAQ tools or an Irfanview command to resize the image before appending
    it to the report.  
    If anyone has any tricks for this one, I'd love to hear them.  
    Patrick Allen

    Here, but like I said, it's a very stupid VI. It doesn't do any avareging or smoothing and it has no mathematical optimization (assuming that there is any). It just removes some of the elements. This has been good enough for displaying images, but might not be good for anything else, because you lose a lot of details.
    Try to take over the world!
    Attachments:
    Resize.llb ‏98 KB

Maybe you are looking for