Validation of the file type being uploaded

Hi,
My requirement is to put a validation on the Primary File metadata field so that it allows only certain type of file types.
Example the primary file should allow only .doc and .pdf and restrict .jpeg/.tiff files
Can any one suggest how this can be implemented ?
Regards,
Bhaskar

You will want to write a validateStandard filter. This will run during the checkin of files.
In the filter you can write code such as:
String filename = binder.getLocal("primaryFile");
Then you can strip that filename String and find the file extension. You can build a list in the actual Java filter that allows/disallows certain filetypes. You could also have this allow/disallow list as a checked-in piece of content (e.g. an XML document) or you could set this as a preference prompt.
Simply looking at the file extension is not bulletproof. You would need to examine the MIME type if you want better security.
This thread linked below has links to the HowTo components which will show you how to implement a filter.
Filter Implementation
Jonathan
http://redstonecontentsolutions.com
http://corecontentonly.com

Similar Messages

  • When I attach a JPG file in my email and send it to a Windows friend they get the message "The file type being saved or retrieved has been blocked when they try to open it." Anyone know why and how to fix this problem?

    When I attach a JPG file in my email message and send it to a Windows friend they get the message "The file type being saved or retrieved has been blocked when they try to open it so that they can save it." Anyone know why and how to fix this problem?

    Your Windows friend should ask in a Windows forum why his email client won't open attached jpg files. We have no idea what email client he is using or how his Windows security is configured.

  • Restrict file types being uploaded as attachments

    Hi,
    We are using SRM3.0 with EBP 4, we would like to restict the file types that users can upload as attachments while creating shopping carts.
    Is there some way that we can maintain a good/ bad list of attachments.
    Thanks
    R.M.

    Hi Joseph,
    Thanks for your reply,
    Could you please explain what is DC30, I cant find any such Tcode or table in srm.
    Thanks
    R.M.

  • Error - The file must match the template type. Upload one file per language

    hi,
    Error - The file must match the template type. Upload one file per language and territory combination.
    i am getting above error while registering RTF template in oracle application e -business suite using XML publisher admistrator responsibility.
    My work :
    i generated xml output using concurrent program.
    for this i used standard PO report,
    the executable name: POXPRPOP.
    i designed the template using MS Office word (for RTF template)
    for this :
    <?start: body?>
    <? for-each: G_Headers?>
    VENDOR:
    <?POH_VENDOR_NAME?>
    <?POH_VENDOR_COUNTRY?>
    PURCHASEORDER NO.
    <?POH_PO_NUM?>
    SHIP TO:
    <?C_COMPANY?>
    <?POH_SHIP_ADDRESS_LINE1?>
    <?POH_SHIP_COUNTRY?>
    BILL TO:
    <?C_COMPANY?>
    <?POH_BILL_ADDRESS_LINE1?>
    <?POH_BILL_COUNTRY?>
    <?end for-each?>
    <?end body?>
    saved this file as "Purchasing.rtf" on desk top
    i registered data definition
    name:purchase order data definition.
    code : short name of concurrent program.
    i try to create template Or register the template in oracle e-business suite.
    name: purchasing template
    code: concurrent program short name
    type : RTF.
    file : browse from desk top (purchasing.rtf)
    language:english
    territory: US.
    but i am getting above error
    could any one help to come out of this problem.
    thank you
    regarding,
    sai krishna@cavaya

    Hi,
    I am getting the error as
    The file must match the template type. Upload one file per language and territory combination.
    I have checked the template name. It doesn't exist already. Please help me.
    Thanks in Advance,
    Jeganathan

  • 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

  • WHen I choose an album, upload a file(s), just as the file(s) is uploaded the file I have chosen disappears and I am asked to choose album again. If I ignore this and drag a file onto the sceneline, I get the "where is the file " message" and when click o

    WHen I choose an album, upload a file(s), just as the file(s) is uploaded the file I have chosen disappears and I am asked to choose album again. If I ignore this and drag a file onto the sceneline, I get the "where is the file " message" and when click on the file it is looking for I get the message "This type of file is not supported, or the required codec is not installed". I have made many little films before but always have this problem now. Any suggestions?

    Margaret
    Although we are continents apart - Australia (Perth) vs North America (US), we will not let time zones interfere with getting your Premiere Elements 8.0/8.0.1 working.
    1. The usual Premiere Elements 8 drill.
    a. Are the automatic features of Background Rendering and AutoAnalzyer turned Off?
    For Background Rendering, see Premiere Elements workspace Edit Menu/Preferences/General. For AutoAnalzyer, see Elements Organizer workspace Edit Menu/Preferences/AutoAnalyzer Options.
    b. Are you running the program from the 8.0.1 Update? If not, see Help Menu/Update?
    c. Do you have the latest version of QuickTime installed on your computer with Premiere Elements 8.0/8.0.1?
    Apple - QuickTime - Download
    2. The usual computer drill....for your Windows XP 32 bit (SP3, I presume)
    a. Is computer opitimized, defragmented, etc.
    CCleaner - PC Optimization and Cleaning - Free Download
    b. Are you running your computer from a User Account with Administrative Privileges? That is important for Premiere Elements 8 as well as for its
    required QuickTime. In addition, right click the computer desktop icon for Premiere Elements 8 and select and apply Run As Administrator.
    3. Project Specifics
    For now, import your source media into the project from the computer hard drive using the project's Get Media/Files and Folders. Leave the Elements Organizer and Albums out of the equation for now. We will circle back to it soon after we decide everything else is working as it should be.
    a. You need to set a project preset. And, that project preset should match the properties of your source media. So important to know properties of source media.
    b. When you import your source media into a project you will get a red line over its content if the project preset is not a match - either because you set the wrong one or the program does not have a match for your particular video. That red line means that you are not seeing the best possible preview of what is being played back in the Edit area monitor. To get the best possible preview, you hit the Enter key of the computer main keyboard to get a rendered Timeline (red line goes from red to green after this type of rendering). That green line over your rendered Timeline indicates that you are now getting the best possible preview. This is solely a preview thing. Longer story, but I will leave it at that for now.
    c. Check Edit Menu/Preferences/Scratch Disks to assure that those Scratch Disks are being saved to a computer hard drive location with enough free space to accept them. Make sure that you do not have pile ups of previews files, conformed audio files, and conformed video files.
    See Local Disk C\Documents and Settings\Owner\My Documents\Adobe\Premiere Elements\9.0
    Never move, delete, or rename source files after they have been imported into a project which has been saved/closed. Otherwise, nasty media disconnect problems. You have only copies of media in Premiere Elements. The originals are on the hard drive, and the project must trace back to the originals where they were at import.
    Based on the above, try to start a new project. But, let me know ahead of time what you will be importing into the project. I am looking for
    Video
    video compression
    audio compression
    frame size
    frame rate
    interlaced or progressive
    pixel aspect ratio
    If you do not know, we could try to get that type of information from knowing the brand/model/settings for the camera that recorded the video.
    Photos
    Pixel dimensions and how many photos?
    Lots and lots of details, but eventually they all mellow into one workflow that you can customize for your projects.
    Please do not hesitate to ask questions or to ask for clarification. We can go at whatever pace you feel comfortable with.
    ATR

  • Setting File type in Upload UI Element

    I want to set the file type as *.doc when the Browse option opens up in the Upload button.
    Is this achievable.

    Hi Soumya,
    Just as the upper 2 experts said,  so far we cann't achieve this in the existing edition of WD..This is not like in traditional ABAP, which we can use such as "Filter" in Dictionary-browser to restrict the file type .
    If we want to use only certain file type in WD, as far as i know, we should only using Coding to handle it..
    Best wishes.

  • Drop Down for Selecting the doc type while uploading?

    Hi all,
    Is it possible to create some document type in KM so that we can select the doc type and  upload the file to specific folder.
    What I mean from Doc type is like Doc for Meetings, Doc for activity report.
    Is it possible using standard KM features? Urgent help needed pls reply.
    Pls send the document regarding this to [email protected]

    Hi Karan,
    I'm not sure if I have understood your issue correctly, but let me try:
    1. You want to upload documents to KM
    2. Uploading them, you want to categorize them in some way, so that they can be identified as docs for meetings, docs for unit XYZ, etc..
    3. After upload, you want each doc to end up in a folder according to its category
    If this is what you want, try the following:
    1. Create a custom resource property called "category" or something similiar.
    2. You may define your possible values for that property. This makes it a drop down box containing the possible values in property view. (You can see property view when uploadinga document)
    3. Mark the property as searchable
    4. Create a taxonomy using TREX searching your repository for the given values of your custom property
    Now you can upload documents, fill the custom property, and some minutes later TREX will create a link to the document in the specified 'category folder'.
    If you need some more detailed assistance, please come back.
    HTH,
    Carsten

  • Import from URL with out knowing the file types

    Hello Gurus,
    I am struck in a strange situation, We need to import files through URL , they may be tiff, pdf, word,excel ...
    and you dont know the file type until you open the URL,
    So i used both ORDIMAGE and ORDDOC for importing, if the import fails in the ORDIMAGE process due to data curropt error , it goes to ORDDOC and the error is taking way too much time to appear.
    1) Is there any way we can find the file type when we open the URL to check if it is a DOC file or Image File.
    2) Is there any way to reduce the time taken to show up the error.
    Thank you

    In Your case, you may need finer control that what import provides.
    You can also use the uri types to upload the image and extract the mime type from the response. You can do the same for orddoc. orddoc may take a long time to parse since the blob must be scanned.
    Larry
    create table uri_imgupload(item_id number primary key, pict ordsys.ordimage);
    create or replace procedure upload_uri_image(prikey_id number, url varchar2 )
    as
    imgobj ORDSYS.ORDImage;
    ctx raw(4000):=null;
    thisrowid urowid;
    urityp sys.URIType;
    BEGIN
    urityp := SYS.URIFactory.getURI(url);
    imgobj := ORDSYS.ORDImage.init();
    imgobj.source.localdata := urityp.getBlob();
    imgObj.setMimeType(urityp.getContentType());
    begin
    imgobj.setProperties();
    Exception
    when others then
    null; -- Ignore exceptions, mimetype is enough.
    end;
    insert into uri_imgupload t (item_id, pict)
    values (prikey_id, imgobj);
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.put_line('EXCEPTION caught '||sqlcode||' '||sqlerrm);
    END;
    show errors;
    DECLARE
    Image ORDSYS.ORDImage;
    ctx raw(4000):=null;
    BEGIN
    utl_http.set_proxy('www-proxy.us.oracle.com:80','*.us.oracle.com');
    upload_uri_image(1, 'http://www.oracle.com/admin/images/ocom/oralogo_small.gif');
    END;
    show errors;

  • Can we limit the file type in Attachment?

    Hi,
    Is it possible to limit the file types that the OAF attachment can upload?
    Thanks!
    Edited by: maeve on Apr 17, 2011 7:09 PM

    Hi Maeve
    You can make use of below code in pfr method of controler
    if(pageContext.getParameter("FileUpload") != null)
    DataObject fileUploadData = (DataObject)pageContext.getNamedDataObject("Bean id of OAFileUploadBean ");
    String contentType = fileUploadData.selectValue(null, "UPLOAD_FILE_MIME_TYPE");
    //Write logic here to limit the file type
    }For more details read JavaDoc as well as refer below thread
    File Upload
    Hope it helps!!!
    Thanks
    AJ

  • Restrict .EXE files from being uploaded

    Hi,
    Can we restrict .EXE files from being uploaded to Business Partner Attachments.
    In our project we have a set of extensions that can be uploaded to the Business partner attachments, Can someone explain me how to restrict this.
    Thanks in advance,
    Karunakar.K

    There is technology known as RMS which you could set series of policies like only members in the company could access certain documents and if someone copy them and attempt to run them in another PC or outside company, it won't work. Take a look at:
    http://blogs.technet.com/b/rms/archive/2013/08/29/the-new-microsoft-rms-is-live-in-preview.aspx
    https://technet.microsoft.com/en-us/library/dd277361.aspx

  • How to filter the file type and size when uploadind files into APEX

    Hi,
    I was wondering how I can do to validate the size of a file, before moving it to my table ? I'd like to filter the file type, but for this one, I think I can use regular expressions in a validation process.
    I don't know if there is a way to read the file size even before sending it into the temporary file table.
    Thank you
    Leinad

    Hello Leinad,
    AFAIK, you have to create an APEX validation (PL/SQL returns Boolean or Returns error text), which will query the file details from apex_flow_files table. Here you can get filetype and size etc.
    So just validate and if any validation fails, then delete the file from apex_flow_files and riase error message.
    Regards,
    Hari
    P.S. Please note that, if there are other apex validations on your page and if they fail, still apex will load the file into apex_flow_files table. So it's good idea to create a validation (PL/SQL) which will fire (condition) when inline validation errors occured. Make sure that this is the LAST validation on your page in sequence. And here you can write code to delete the file from apex_flow_files table.
    Edited by: Hari_639 on Sep 20, 2012 10:09 PM

  • When replacing an .indd on creative cloud, it changes the file-type

    I have uploaded a few InDesign (.indd) files from cs5.5 to my creative cloud account so I can share them with my team for approval / feedback. If I try and replace the file with a newer version (still .indd from cs5.5) it changes the file type to octet-stream and it can't be viewed.
    Restoring back to the ORIGINAL version brings back the original, as an indesign file, and it is viewable again.
    Am I doing something wrong when replacing a file? This seems like the logical way of doing it (they even refer to them as revisions, as that seems to be the point)

    My workplace uses CS5.5. I'm in the process of convincing them to move to CC by personally signing up to the month/month plan (however this isn't helping).
    I am uploading using Chrome Version 29.0.1547.66 m.

  • I tried to change the file type of the movie, but now I am unable to open/edit it in iMovie, HELP !

    I tried to change the file type of the movie, but now I am unable to open/edit it in iMovie, HELP !

    Thank you very much! This is exactly what I was looking for.
    I appreciate your time and effort in solving my question : )

  • Why can I not attach a document to an email? Every time I want to send an email with a document attached to it, an error notice pops out. It tell me that the file is being used even when  it is not. How can I fix this issue?

    Why can I not attach a document to an email? Every time I want to send an email with a document attached to it, an error notice pops out. It tells me that the file is being used even when  iall other programs are closed. How can I fix this issue?

    Thanks Jeff, I was not aware that a template could be multi-page.  (All the existing templates were 1 page)
    But it worked, saving me some steps.  When I was finished I renamed the document, and locked it.
    Then tried to save it but  could not because it was locked.  I closed it, went to my Spread Sheet Folder ,
    to find it, it was not there.  The Finder could not find it either.
    So I start over again.
    I opened up Numbers and it showed my personal Numbers template folder, it contained both my new 
    original 4 page template and the vanished saved document!
    I tried to delete the template containing these document data and could not - I had to go to the Library/Application Support/Numbers to physically remove it from this folder. Then I started over again.  I Finally found out how to make it work: I can now "save as", and then lock, and it will go to place where I want it to be saved and locked.
    The secret is: Click on the document title in the menu bar, and it opens up  "Save as...", which works the same as in OS 10.4.11, and you can pick the place you want for saving.  Once done that, you can then lock the document in the same pull down menu, and then close it.
    I also found later that I can delete a template from its folder, by letting Numbers open the templates,
    clicking on the one I want to remove, then go to the "Numbers Menu/File/Move to...", select "Desktop"
    and from there the selected template can then be thrown into the Trash from there.
    It appears now that the real fault of the Numbers software is that the "Save as" command is not available in the "Edit" or "File" pull-down menus, but hidden behind the title of the document.

Maybe you are looking for