Limit File Type and file size in attachment table.

Dear All,
I want to limit file type like .jpg,.mpgv files while ataching files in attachment table in oracle apps. Also want to limit file size.
Please help.
Thanks

Refer below link regd implementing file upload:
File Upload
We can get file type using
DataObject fileUploadData =
(DataObject)pageContext.getNamedDataObject("fileInput2");
//here OAFileUploadBean is "fileInput2"
String contentType = fileUploadData.selectValue(null, "UPLOAD_FILE_MIME_TYPE");
Based on this file type write your login in processFormRequest.
Will let you know if I find anything about size also.
-Anand

Similar Messages

  • Errors when using "Limit file size to" when exporting images

    When I try to use the "limit file size to" option in Export, I often get at least one image that doesn't export, and I get a dialogie box like the image attached here:
    As I am exporting in batches, it geats really messy and risky too!I have tried various file size options but that doesn't seem to be a factor.
    Any ideas on solving this, or is it an unfixed Lr bug?!
    thanks in advance

    I can't reproduce it here, so you could try trashing the preferences file http://members.lightroomqueen.com/index.php?/Knowledgebase/Article/View/1148/198/how-do-i- delete-the-lightroom-preferences-file
    If that doesn't do the trick, post it on the Official Feature Request/Bug Report Forum

  • Selection properties panel -  edit font type and font size

    "selection properties" bottom panel -  edit font type and font size
    In design view
    i can no longer find this option in CS5,
    how can i change font type and font size of highlighted/selected block of text? like previous DW versions ?
    by switching to CSS from html in "selection properties" bottom panel.
    i see an option to do that using CSS. Is this the only option now ?
    Thanks a lot for help.

    What happened if on some pages of my site, there are JS code inserted to display content pulled from other remote host.
    Will my own page or site CSS font setting override the JS code font & size setting as well ?
    or those JS code can display content using their font selection setting independently ?
    >> Yes. In fact it not only does it for the page you're working on, but for the whole site (that's the advantage of CSS vs properties)

  • How to restrict users from uploading malicious files(exe, dll,etc) & limit file size in a webform

    Hello, please i have a file atachment field in a form on my site. I want to restrict the size of the file that can be uploaded and the type. It's a vacancy page and I want candidates to only upload doc and pdf files. I want to also limit the file size to 50mb only. How can this be done within the BC system.
    Thanks.

    The file extension can't be trusted, like the mime-type it can be faked by a malicious user. Also this method can just be avoided altogether by anyone who has javacript turned off. Using javascript for this is not even remotely secure.
    Isn't there a way to allow file uploading but specify a whitelist of filetypes (preferably checked using byte headers or some effective method) somewhere in admin?
    Liam Dilley wrote:
    Hey there,
    You can do the file extension with jquery for example. The basic aspect of that is:
    var ext = $('#my_file_field').val().split('.').pop().toLowerCase();
    if($.inArray(ext, ['exe','dll','jpg','jpeg']) == -1) {
        alert('invalid extension!');
    So what is hapepning there is that it checks the value of the field when someone has added the file and checks the file extensiona and produces an alert but you can do as you need.
    You could run this on hover of the submit button, on change of the actual file attachement field or on click of the submit button in the checks before it submits.
    BC limits files to 100mb anyway so you should be ok on that front, they wont be able to be crazy uploading.

  • How to limit file size for FileUpload UI element?

    Hi all,
    I'm using the FileUpload UI element in NW2004s SP20.
    I want to limit the size of the uploaded file.
    The simple option is to load the file to the context, check the size, by using
    InputStream stream = resource.read(false);
    double size = stream.available();
    and report errors if any.
    However, I don't want to store huge files in the context or flie system (even temporarily) nor 'spend' network resources for uploading a file that I won't be use...
    Is there a way to limit the file size by using some property for the fileUpload UI element in the server?
    Is there a way to check the file size before it's uploaded (for example like GMAIL does - checks the file BEFORE the actual upload)
    Regards,
    Omri

    Hi Omri,
    "(but this can be checked AFTER the file was uploaded)" - what do you really mean here? I mean your main query is to restrict the file upload if it crosses certain size-limit. What is the use if you check the size after upload?
    My problem is the network traffic and the CPU load if users are trying to download huge files..., if the upload is restricted for size this download problem will not come .. correct?
    Not sure about the UI element properties has something to restrict the size, and if its really related to Network traffic and CPU utilization, i think you've to check with Basis team to re-sizing the servers to meet this new requirement of upload/download if its not considered before.
    Or the last option i could see is to use KM Upload iView if sizing is done with these considerations.
    Thanks,
    MS

  • How to limit file size in LR for photomerge in PS5

    Is there a simple way to limit the file size of the photos selected in LR3 for a photomerge in PS5?
    I have found that without limiting the size, the panoramas generated are very large - 1GB or greater.
    I've found an work around by opening the photos in Bridge and then in Camera Raw where I can reduce the file size before using PS5 for photomerge.  After I've done this, it's a bit of a hassle to get the panorama back into LR3.  The benefit of this approach is that it speeds up the processing significantly and helps downstream with any subsequent processing since the files are just large and not ginormus. 
    If this isn't possible, this seems like a good idea for LR4.
    Thanks, Chris

    A tip of mine that Martin Eveing includes in his Lr2 and Lr3 books is as follows:
    1. In Lr, selct the images you wnat to included in pano
    2. From Edit in Ps menu choose "Open as Layers". The images will all open as layers in CS5
    3. In CS5 choose Image Size from Edit menu and downsize images
    4. In CS5 choose Select all Layers (Cmd+Option+A or Ctrl+Alt+A)
    5. In CS5 Edit menu choose Auto Align.
    The rest of the process should be self explantory

  • Webdynpro to limit MIME types and size

    Hi,
    I need to write an web dynpro application to limite the file type and size using IWDFileUpload API, does anyone has some suggestion ?
    Thanks a lot.
    Kind regards
    Ben.J.

    Hi Ben,
    I think you can restrict the file type and and also check the file size before uploading the file. You need to write the logic to check out the file type.
    Use the following code to check restrict the file upload of only txt file...
              IPrivateTestView.ITestElement pf =
                   wdContext.nodeTest().currentTestElement();
              IWDMessageManager mgr = wdComponentAPI.getMessageManager();
              if (pf.getFileResource().getResourceType().getFileExtension() != null
                   && pf
                        .getPatchResource()
                        .getResourceType()
                        .getFileExtension()
                        .equalsIgnoreCase(
                        "txt")) {
    // Check if file size is in valid range.. call getFileSize()
    mgr.reportSuccess("File can be uploaded");
              } else {
                   mgr.reportException("Kindly upload ont TXT files", false);
    And use following code for calculating File Size:
         private String getFileSize(IWDResource resource) {
              InputStream stream = null;
              DecimalFormat myFormatter = new DecimalFormat("###.##");
              double size = 0;
              String unit = "";
              try {
                   stream = resource.read(false);
                   size = stream.available();
                   if (size < 1024) {
                        unit = " Bytes";
                   } else if (size < 1048576) {
                        size = size / 1024;
                        unit = " KB";
                   } else if (size < 1073741824) {
                        size = size / 1024 / 1024;
                        unit = " MB";
              } catch (IOException e) {
                   wdComponentAPI.getMessageManager().reportException(
                        e.getLocalizedMessage(),
                        true);
              } finally {
                   if (stream != null) {
                        try {
                             stream.close();
                        } catch (IOException e) {
                             wdComponentAPI.getMessageManager().reportException(
                                  e.getLocalizedMessage(),
                                  true);
              return myFormatter.format(size) + unit;
              //@@end
    This way you can restrict the users. As far as I know there is no standard way of restricting the same
    Hope it helps
    Regards
    Abhinav

  • Export to jpg - limit file size vs resize to fit - best option or same?

    Hi,
    Sorry if this has been asked before, I take a large number of event images and the usual client request for images being sent to the press is image size rather than resolution, dimensions or other requirements.
    Clearly in LR3 if the client has requested 3MB jpg the easy option is to after processing take my Canon 5d mkii RAW file and just hit export to max 3MB jpg.
    My question is is it better - ie image quality better - to export by resizing longest edge to approx 3000 px and exporting to jpg which results in a similar file size, though different pixel dimensions? Or are they effectively the same?
    Any thoughts?
    Many thanks in advance on best practice....
    Cheers,
    dxbluey

    To tell you the truth, a client asking for a 3MB JPG is a very meaningless thing to do.
    Any time you are changing the number of pixels on a side, you are changing the image quality. Any time you are forcing the photo to be a certain size in MB other than the maximum, you are accepting a certain reduction in image quality. Which is worse? It all depends on the original, and how much change you are asking for.
    So, that's my answer ... IT ALL DEPENDS.

  • Max file size in Attachment Page

    Hi,
    Whats the maximum size of the file which can be attached to an attachment page?
    Thanks,
    Gowtam.

    Shiv,
    I tried in one of my old pages a 10mb non-pdf file, the page went into error!
    Anyways,
    Gowtham if ur raising a TAR, do update this thread with ur final results/TAR number.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Attachments and instance size ? (Attaching from Global Create)

    Is it true that if you want to allow users to make attachments from Global Create, you must set your "MAX Instance Size" to be at least as big as the Attachments coming in?
    In Global Create, if you want to allow user to make attachments, it seems (from the documentaiton and the sample projects) that you must have an argument to recieve the binary data, and a corresponding instance variable to which it is mapped to. Then after the Begin activity, you can create the attachment using the instance variable.
    Is there some other way to do this without instance variables holding the binary data?
    Also, making the instance variable "SEPARATED" is not a solution, because there is a max size of 2Mb on separated instance variables. I am anticipating attachments up to 100Mb
    Edited by bcespinola at 09/21/2007 8:15 AM

    Manoj,
    We found a workaround that works in Studio workspace. We are getting ready to deploy it to our ALBPM server and test it there.
    Workaround:
    Instead of passing attachment (binary data and file names) to process via Process Arguments, then mapping the arguments to instance variables, then creating attachment from instance variables, we use the Fuego.Io.BinaryFile.
    there are 2 methods on this we use:
    1) writeFromBinaryTo
    2) readToBinaryFrom
    So from the screenflow in the global create, we have screenflow level variables receiving the binary data and filenames from the posted JSP. In the screenflow, we then use "writeFromBinaryTo" method of BinaryFile object and for the 'name' paramter, provide a full path on the server to where we want the file written.
    then we pass a string containing the file's full path as an argument to the process, mapped to an instance variable.
    Then, after instance is created, we have an automatic that uses local a variable (not instance variables) to hold Binary data and filenames. We then use "readToBinaryFrom" method of BinaryFile object, again using the string containing the full path to the file on the server, as the "name" parameter to the method. This method returns a object represting the binary data. then you can use the "create attachment" code, passing in the binary data and file name to create the instance attachment.
    Finally, we do some cleanup by deleting the file that was uploaded to the server (delete method of Fuego.File)
    So in summary, instead of passsing the filename and binary data as arguments to the process, we basically are using fuego object to do a file upload to the server, then after instace created, we get reference to file on server and create attachment from there. Now our instance size can be small, but process can still handle large attachments.
    Hope that helps.
    Edited by bcespinola at 10/03/2007 6:11 AM

  • Data type with large size in a table and updating it

    Hi guys,
    i am working on a requirement in which i need to create 4 tables. Here, 2 tables will be updated by the user and a program will update this content to the other 2 table.
    2 days before i posted a query on this, Previously i stucked on a part where, table need to entries with size char 400 and char 9000. As from the reply, i changed it to STRING with which table was sucessfully created and i was able to update data through a report program.
    Now we ned to provide an sm30 option to users, so they can insert new contents and update the status of old contents. But when i tried this table maintanance generator, i got an error that table contains string, so maintanance generator cannot be done ! i changed the data type to rawstring also. Now maintanance generator got saved, but when i open the table in sm30, i am getting dump saying tht table is using string/char etc.
    can anyone tell me what data type to use in this scenario with which we can enter data through sm30 ?

    Hi Kithu,
    you can use STRING (or XSTRING) fields. Then there is no limit on the field size. As long as it is not (fully) filled with data, no space is wasted.
    The disadvantage is that STRING type data are treated as 'deep' structures. That leads to some trouble in the definition of interfaces. Give it a try!
    Regards,
    Clemens

  • Dump File Size vs Database Table Size

    Hi all!
    Hope you're all well. If Datapump estimates that 18 million records will produce a 2.5GB dumpfile, does this mean that 2.5GB will also be consumed on the database table when this dump file is imported into a database?
    Many thanks in advance!
    Regards
    AC

    does this mean that 2.5GB will also be consumed on the database table when this dump file is imported into a database?No since the size after import depends on various factors like block size, block storage parameters etc.

  • Changing row or cell background and Font size in the table in Adobe Form

    Hi Experts,
    I have a problem in the Adobe Forms (Non-interactive). I have developed a form in which a table is displayed dynamically. I wanted to highlight some rows depending upon the cell value.
    Kindly help me regarding this .
    Thanks,
    -R.S-
    Moderator message: wrong forum, please have a look in the forum for "Adobe Interactive Forms".
    Edited by: Thomas Zloch on May 3, 2011 5:54 PM

    hi,
    you have to use a script for the tableline like formcalc or javascript to implement that logic.
    regards,
    christian

  • Limit file type and size in Solution Manager

    Dear gurus,
    I'm writing an inquiry about the possibility of specifying file extension type and the size the user can upload to solution manager, for example in roadmap / configuration.
    I.e, we need to limit the user not to upload *.avi extension type, and limiting the size to 5MB.
    Thanks for help.
    Regards,

    Hi Bobby,
    Once you insert a file extension in table SADOCGENERIC,  after that, all documents with this file extension will be open and
    should be editable out-of-place with no edit restrictions. You'll just need to have a way to edit it in your computer.
    Kind regards, Fabricius

  • Send An Internal Table Via Excel File As An Attachment of E-mail

    Hi,
    I've sent my internal table via Excel file as an attachment of email but all records of internal table are in a row of sended excel file.
    How can i send an internal table via excel file , records of internal table for each rows of excel file,as an attachment of email correctly?
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list     "   t_packing_list-doc_type   =  'XLS'.
                contents_bin               = pit_attach " this is a normal internal table.
                contents_txt               = pit_message
                receivers                  = t_receivers
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                OTHERS                     = 8.

    Hi,
    CLASS CL_ABAP_CHAR_UTILITIES DEFINITION LOAD.
    CONSTANTS:
    CON_TAB TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,
    CON_CRET TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.
          LOOP AT T_FINAL INTO WA_T_FINAL.
            CONCATENATE WA_T_FINAL-PERNR
                        WA_T_FINAL-NAME
                        WA_T_FINAL-LEVEL
                        WA_T_FINAL-POS
                        WA_T_FINAL-JOB
                        WA_T_FINAL-SECTION
                        WA_T_FINAL-DEPT
                        WA_T_FINAL-GROUP
                        WA_T_FINAL-EX_HEAD
                        WA_T_FINAL-SUPID
                        WA_T_FINAL-SUPNM
                        WA_T_FINAL-FHRNM
                        WA_T_FINAL-VACID
                        WA_T_FINAL-VAC_SECTION
                        WA_T_FINAL-VAC_DEPT
                        WA_T_FINAL-VAC_GROUP
                        WA_T_FINAL-VAC_EX_HEAD
                        WA_T_FINAL-VAC_FHRNM
            INTO T_FINAL3 SEPARATED BY CON_TAB.
            CONCATENATE CON_CRET T_FINAL3 INTO T_FINAL3.
            APPEND T_FINAL3.
          ENDLOOP.
    *Fill the document data.
      W_DOC_DATA-DOC_SIZE = 1.
    *Populate the subject/generic message attributes
      W_DOC_DATA-OBJ_LANGU = SY-LANGU.
      W_DOC_DATA-OBJ_NAME = 'REPORT'.
      W_DOC_DATA-OBJ_DESCR = LD_MTITLE . "mail description
      W_DOC_DATA-SENSITIVTY = 'F'.
    *Fill the document data and get size of attachment
      CLEAR W_DOC_DATA.
      READ TABLE T_FINAL1 INDEX W_CNT.
      W_DOC_DATA-DOC_SIZE =
      ( W_CNT - 1 ) * 255 + STRLEN( T_FINAL1 ).
      W_DOC_DATA-OBJ_LANGU = SY-LANGU.
      W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
      W_DOC_DATA-OBJ_DESCR = LD_MTITLE.
      W_DOC_DATA-SENSITIVTY = 'F'.
      CLEAR T_ATTACHMENT.
      REFRESH T_ATTACHMENT.
      T_ATTACHMENT[] = PT_FINAL1[].
    *Describe the body of the message
      CLEAR T_PACKING_LIST.
      REFRESH T_PACKING_LIST.
      T_PACKING_LIST-TRANSF_BIN = SPACE.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM = 0.
      T_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE IT_MESSAGE LINES T_PACKING_LIST-BODY_NUM.
      T_PACKING_LIST-DOC_TYPE = 'RAW'.
      APPEND T_PACKING_LIST.
    *Create 1st attachment notification
      T_PACKING_LIST-TRANSF_BIN = 'X'.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM = 1.
      T_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE T_ATTACHMENT LINES T_PACKING_LIST-BODY_NUM.
      T_PACKING_LIST-DOC_TYPE = LD_FORMAT.
      T_PACKING_LIST-OBJ_DESCR = 'Application 1'.
      T_PACKING_LIST-OBJ_NAME = 'Application 1'.
      T_PACKING_LIST-DOC_SIZE = T_PACKING_LIST-BODY_NUM * 255.
      APPEND T_PACKING_LIST.
      CLEAR T_PACKING_LIST.
    *Add the recipients email address
      CLEAR T_RECEIVERS.
      REFRESH T_RECEIVERS.
      T_RECEIVERS-RECEIVER = LD_EMAIL.
      T_RECEIVERS-REC_TYPE = 'U'.
      T_RECEIVERS-COM_TYPE = 'INT'.
      T_RECEIVERS-NOTIF_DEL = 'X'.
      T_RECEIVERS-NOTIF_NDEL = 'X'.
      APPEND T_RECEIVERS.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA              = W_DOC_DATA
          PUT_IN_OUTBOX              = 'X'
          SENDER_ADDRESS             = LD_SENDER_ADDRESS
          SENDER_ADDRESS_TYPE        = LD_SENDER_ADDRESS_TYPE
          COMMIT_WORK                = 'X'
        IMPORTING
          SENT_TO_ALL                = W_SENT_ALL
        TABLES
          PACKING_LIST               = T_PACKING_LIST
          CONTENTS_BIN               = T_ATTACHMENT
          CONTENTS_TXT               = IT_MESSAGE
          RECEIVERS                  = T_RECEIVERS
        EXCEPTIONS
          TOO_MANY_RECEIVERS         = 1
          DOCUMENT_NOT_SENT          = 2
          DOCUMENT_TYPE_NOT_EXIST    = 3
          OPERATION_NO_AUTHORIZATION = 4
          PARAMETER_ERROR            = 5
          X_ERROR                    = 6
          ENQUEUE_ERROR              = 7
          OTHERS                     = 8.
    Edited by: Rahul Ghosh on Apr 6, 2009 6:42 AM

Maybe you are looking for