API to restric size and type documents uploaded

Hi Guys,
I'd like to know if exists any api to restrict the each document size and type, when you upload it?
For example, load anly documents type .pdf with size no higher than 4K.
Thanks.
Ciao.Liliana.

How about using folder quotas to tackle the size issue? As for file types, I'm not sure on how this could be done.

Similar Messages

  • How is it posible to get the File name, size and type from a File out the H

    How is it posible to get the File name, size and type from a File out the HttpServletRequest. I want to upload a File from a client and save it on a server with the client name. I want to conrole before saving the name, type and size of the file.How is it posible to get the File name, size and type from a File out the HttpServletRequest.
    form JSP
    <form name="form" method="post" action="procesuploading.jsp" ENCTYPE="multipart/form-data">
    File: <input type="file" name="filename"/
    Path: <input type="text" readonly="" name="path" value="c:"/
    Saveas: <input type="text" name="saveas"/>
    <input name="submit" type="submit" value="Upload" />
    </form>
    proces JSP
    <%@ page language="java" %>
    <%@ page import="java.util.*" %>
    <%@ page import="FileUploadBean" %>
    <jsp:useBean id="TheBean" scope="page" class="FileUploadBean" />
    <%
    TheBean.doUpload(request);
    %>
    BEAN
    import java.io.*;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletInputStream;
    public class FileUploadBean {
    public void doUpload(HttpServletRequest request) throws IOException
              String melding = "";
              String filename = request.getParameter("saveas");
              String path = request.getParameter("path");
              PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("test.java")));
              ServletInputStream in = request.getInputStream();
              int i = in.read();
              System.out.println("filename:"+filename);
              System.out.println("path:"+path);
              while (i != -1)
                   pw.print((char) i);
                   i = in.read();
              pw.close();
    }

    Thanks it works great.
    Here an excample from my code
    import org.apache.commons.fileupload.*;
    public class FileUploadBean extends Object implements java.io.Serializable{
    String foutmelding = "geen";
    String path;
    String filename;
    public boolean doUpload(HttpServletRequest request) throws IOException
         try
         // Create a new file upload handler
         FileUpload upload = new FileUpload();
         // Set upload parameters
         upload.setSizeMax(100000);
         upload.setSizeThreshold(100000000);
         upload.setRepositoryPath("/");
         // Parse the request
         List items = upload.parseRequest(request);
         // Process the uploaded fields
         Iterator iter = items.iterator();
         while (iter.hasNext())
         FileItem item = (FileItem) iter.next();
              if (item.isFormField())
                   String stringitem = item.getString();
         else
              String filename = "";
                   int temp = item.getName().lastIndexOf("\\");
                   filename = item.getName().substring(temp,item.getName().length());
                   File bestand = new File(path+filename);
                   if(item.getSize() > SizeMax && SizeMax != -1){foutmelding = "bestand is te groot.";return false;}
                   if(bestand.exists()){foutmelding ="bestand bestaat al";return false;}
                   FileOutputStream fOut = new FileOutputStream(bestand);     
                   BufferedOutputStream bOut = new BufferedOutputStream(fOut);
                   int bytesRead =0;
                   byte[] data = item.get();
                   bOut.write(data, 0 , data.length);     
                   bOut.close();
         catch(Exception e)
              System.out.println("er is een foutontstaan bij het opslaan de een bestand "+e);
              foutmelding = "Bestand opsturen is fout gegaan";
         return true;
         }

  • The box in my Photoshop Elements, which shows the size and types of brushes has shrunk to one unreadable line. How do I expand the box to its original size?  I have tried dragging it open but nothing moves.

    The box in my Photoshop Elements, which shows the size and type of brushes, has shrunk to one unreadable line. How can I expand this box to its original size? I have tried dragging it open but nothing happens and none of the tool boxes appear to give me an expansion option

    Well, when you open the program, the splash screen, the window you see while the program is opening, should make that clear enough. For example:

  • Image size and type

    what Icon / Image size and type we should use of our own menu ?
    Giuseppe

    Hi Giuseppe,
    I'm not sure what restrictions there are on image type but I always use a 24bit Bitmap image with width 18px and height 14px. For transparency, set the background colour to RGB 192-220-192 and SBO will automatically make this area transparent, regardless of the colour scheme the user has on the client.
    Kind Regards,
    Owen

  • Options to view file size and type?

    Where can I turn on options on an image and get the file size and type?
    Thanks.

    Stan,
    You can see the file type by hovering over the file in Library view and it will show the file name followed by the extension like jpg, nef or tiff.
    Alternatively in library mode go to grid view it will pixel size of the files as well as the name of the file withthe format.
    If you are not able to see that go to View>View Option.
    Check the option show header with label
    Hope thatt helps.
    Mandhir

  • Just upgraded to Win 8.1: PSE 11 now will not let me change the paper size and type in the print properties.

    I have just upgraded to windows 8.1 but my photoshop elements 11 now will not let me change the paper size and type in the print properties.  Also some of the property popup boxes just flash on the screen but do not stay displayed!

    Camera Raw plug-in | Supported cameras
    Camera Raw-compatible Adobe applications
    The D7100 requires Camera Raw 6.5 which is compatible with CS5.
    In CS5, click Help > Updates to update Camera Raw to 6.7 and you'll be able to open and edit Raw D7100 NEF files.

  • ERROR Message: Printer size and type paper is incorrect

    ERROR Message: Printer size and type  paper is incorrect. Its set for automatic detection and regular paper. I unstinstalled and reinstalled the software...and tried other settings. It wont be print just cancels.

    Please read this post then provide some details.  What printer model? What operating system? 
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • With iMovie 10 how do I change the movie file size and type.

    I have recently upgraded to iMovie 10. It takes some getting used to but I think I will like the new product. After creating my first few movies and trying to upload them to dropbox, it is taking a long time. Comparing the files to ones created in the previous version they are larger, and I need to know how we adjust the file size to the device the movies will be used for. I don't need high resolution files.  It looks like you can change the size in file for share but still a large file and only compatible with Mac and PC others are greyed out. Files are much larger than the files generated in the old version.
    Thanks any help will be appreciated.

    This is one of the areas where the options have been reduced compared to iMovie 9.  If you share to File, you should have Large (540p) and SD (480p) options in addition to the HD ones. 
    I'm not sure exactly which menu it is where you are finding greyed-out options.
    What is the native format of the movie you are saving?
    If you can't share directly into the format you want you should be able to post-process the shared file with a third-party app.
    Geoff.

  • Font size and type in BSP applications

    Hi all,
    We are creating some reports using BSP for our SRM users. But we are not able to determine the size and the type of font used by SAP in the SRM applications.
    If we use font with size 1, it turns out be smaller than the SAP font and size 2 is bigger than the SAP font
    Does any one know how to make a BSP report in SAP style with table (alternating grey color), header in blue and so on.
    It would be great information
    Thanks and Rgds
    Venkat

    Are the subtitles already in place in the stream for the film? Sounds like they are. If so select one of the subtitles and change it's formatting then Apply to stream. That should work. If you change the preferences that will only apply to newly created subtitles (I'm assuming you don't have the subs as an external file and have created them in DVD-SP?)
    Steve

  • Font size and type not changing in subtitles

    I have tried to change the size and font of my subtitles in my DVD SP Preferences (DVD SP 3). They change in the settings window but the size and font of the subtitles in the film remains the same which is huge
    I have clicked apply in the prefrences menu but nothing changes in the film.
    Am I missing something?

    Are the subtitles already in place in the stream for the film? Sounds like they are. If so select one of the subtitles and change it's formatting then Apply to stream. That should work. If you change the preferences that will only apply to newly created subtitles (I'm assuming you don't have the subs as an external file and have created them in DVD-SP?)
    Steve

  • Abap MDM API - get table fields and types

    Hi gurus,
    dealing with a simple task for my development... I need to retrieve, for a given MDM table name, a list of field's names with their data types in Value_pair format.
    Basically, this is what RETRIEVE method does; but:
    - I don't need any value; I just need to know which fields build up the table (in order to create entries for that)... Let's say that I'm interested in the CODE and the TYPE  fields of an MDM_NAME_VALUE_PAIR structure describing each field of my MDM table.
    - I can't workaround extracting a certain index (say, the first) from the table using a RETRIEVE, as the target table could also be empty.
    How to do that?
    Thanks in advance

    Hello Binori,
    Thanks a lot for the immediate reply!
    I have connected MS SQL server mgmt studio to MAP tool, as you have already mentioned!
    How do I get access to MAP's db, since I need data from MAP's db in our application db, and our application is purely java based.
    For ex: I need data of all Operating Systems, Performance metrics, Server name, Hardware Configurations etc.
    Thanks in advance,
    Sheetal 

  • EyeTV files sizes and types?

    Hi,
    Thinking of getting and EyeTV for use in the UK and with digital FreeView channels.
    What sort of files does it generate?
    Is it just a QuickTime file that can be played on any Mac?
    What size files do you get for an average 30 mins show?
    The reason I need to know is the TV I record will be sent to my friend in Canada to watch on their 20" iMac G5, I have a fixed IP and a 8MB pipe so they can log into my Mac and just download the shows they want.
    What is the quality like I have the Formac DV studio with a TV tuner and the quality is bad all noise and interference lines in the images. Don’t use it any more.
    Any views are appreciated
    R

    The eyeTV 410 is a great piece of kit and I use mine all the time.
    It records in a MPEG 2 format which can then be exported in a range of different file formats if required.
    As it is native MPEG 2 format, combine it with Toast and it makes it very easy to burn DVDs of your recordings.
    As it is MPEG 2 you can not play the native files using Quicktime (however the eyeTV software can play them). If you export as MPEG 2 then you will need the MPEG 2 component for Quicktime, or play them with VLC.
    A 30 min show is approx 500MB.
    However if you export to another format then you will be able to compress that file size.
    The eyeTV 410 is four times the quality of my eyeTV USB which recorded analogue.

  • Adding chapters while preserving the original file size and type.

    Gone are the days of easily adding chaps in FCP7.  FCPX is here… chapters are gone!.  Now enter Compressor 4. 
    When exporting from Compressor am I ultimately going to end up with an additional file with new settings?
    I have followed the Compressor manual and understand that I can “Create a new batch from template” and am supposed to choose Create DVD.  I however just want to keep my file in its original maximum resolution while gaining the chapter marks that will be recognized in iDVD or Studio Pro.
    Can anybody offer me some advice or point me to some good resources? 

    Assume you're referring to Compressor 4, although the following would pretty much also apply to earlier versions.
    Yes; you will have an additional file with chapter markers.
    Select a preset…you can start with any of them, but Pro Res 422 makes the most sense.
    If your source file (the exported Quick Time file) was PR 422, it will not change the scale and will preserve the quality of your original file (or close enough so you wouldn't be able to see the difference even with a blown up projected image). If, for some reason you a codec other than Pro Res, go to the Inspector>Encoder pane>Video Settings>Compression Settings and make your choice. 
    In the Preview window, set the chapter markers, which are frame-accurate in an I Frame format like Pro Res.
    Submit and Compressor will spit out a high quality QT movie. You can then bring that movie into iDVD, which will recognize your markers.
    If you want to use DVDSP, you have two options. 1) You can let DVDSP do the encoding by importing the QT movie with chapters. 2) You can use Compressor to encode; you choose the DVD preset (Disk Burning) and it creates separate audio and video files that you then bring into DVDSP, which will "see" your markers in these files. Most DVDSP users use the second method because they have far greater control over the compression settings…but that presumes the user is relatively familiar with Compressor and Frame Controls.
    Finally, bear in mind that DVDs are standard definition, so – however you get there – the DVD will be much more compressed and much smaller resolution than any High Def format. However, the DVD end product can still look very good. Do some tests with small, but representative sections of your movie to see whether iDVD or DVDSP works best for you.
    Good luck.
    Russ

  • Drive size and Type?

    Am interested in filling the single drive bay of the NMH305  -- Is there anything wrong with putting in a 1.5 - 2.0 TB drive? Is there anything wrong in installing a WD EARS or EADS drive?
    Thanks

    You can check the harddrive tested list on the Linksys article below.
    NMH Series Hardware Tested List
    Cheers.

  • Font and type size automatically revert in Numbers

    No matter what font or type size I use in a spreadsheet, when I move to a new cell, the font and type revert to the default, Helvetica Neue 10 point. If I set a block of cells to a certain font and size, they work properly until i have to cut and paste something out of a cell, then that cell reverts back. No one seems to know why this happens. Any ideas on changing the defaults permanently?

    You can set the default for each table style and, if you want, save your changes as a template which you can use for new documents.
    What I think you are doing is setting the font size and type for a cell and expecting it to apply for all cells. It does not.
    If you want this to be a default style for all new documents, first open up a new blank template. Otherwise do this in your current document. Select the table then select all cells (cmd-A). Change the font and type. The entire table should change. That's all you have to do if you are concerned about this single table in this one document.
    If you want to have new tables start out with that same font and style, go to the lower part of the sidebar on the left where the table styles are. Find the one that looks like the one you started with. Click the disclosure triangle and choose "redefine style from table". From then on in this document any new tables created from that table style will have the font and style you specified. Do the same for the other table styles if you want to. If you want one of them to be the default table style, choose that in the sidebar also. If this is a new document and you save it as a template and you use that template for new documents, those documents will also have your new table style(s).

Maybe you are looking for

  • My phone won't download apps it says waiting loading and then it says it cannot be installed

    My phone will not let me download apps anymore I have logged out of iTunes and logged in again but that didn't work. When I try to download apps it will say waiting, installing, then it will start over like 3 times, then it will say unable to downloa

  • How to retrieve all files in a given directory?

    Hi all, I am a newbie to Java. I have to retrieve all files in a given directory. The names of the files are not known to me. Only the name of the directory is known. How can I retrieve and read all those files? Gary

  • Error 8, when writing to a file

    Hello everyone. I just found that "Comments and Array to txt" VI in another forum, and i have problems to write in a excel file. When i run the VI, it gives me that error : How to handle that problem ? Thanks in advance Oesen Best regards Oesen Attac

  • Upgrading Planning from 11.1.2.1 to 11.1.2.2 BR/Calc Manager Issue

    Hi Gurus, I am attempting to apply the 11.1.2.2 maintenance release to my 11.1.2.1 environment however I have a question that I cannot find the clear answer to. We have never used Calc Manager so it was never installed. I have already applied the mai

  • Make it go away! Removing LDOMs?

    How do I get rid of LDOMs entirely from a T2000? I want to get rid of all of the I/O and vldc stuff from the primary domain and go back to the old setup. I've tried uninstalling LDOMs and going back to 6.3.7 firmware but I get vldc hypervisor errors