Client to Server upload: File size limit

Hi,
I am utilising java sockets to set up 2 way communication between a client and server program.
I have successfully transferred files from the client to the server by writing/using the code shown below.
However I now wish to place a limit on the size of any file that a user can transfer
to the server. I think a file size limit of 1 megabyte would be ideal. Does anyone know a straightforward
way to implement this restriction (without having to perform major modification to the code below)?
Thanks for your help.
*****Extract from Client.java******
if (control.equals("2"))
     control="STOR";
     System.out.print("Enter relevant file name to be sent to server:");
     String nameOfFile = current.readLine(); //Read in the name of the file to be sent, store in a
addLog("File name to be sent to server: " +nameOfFile);
     if(checkExists(nameOfFile)) //Call the checkExists method to make sure the user is sending a
     infoOuputStream.writeUTF(control);
     infoOuputStream.writeUTF(nameOfFile); //write the file name out to the socket
     OutputStream out = projSocket.getOutputStream(); //open an output stream to send the data
     sendFile(nameOfFile,out);
     addLog("File has been sent to server " +nameOfFile );
     else
          System.out.println("Error: The file is invalid or does not exist");
          addLog(" The user has attempted to send a file that does not exist" +nameOfFile);
private static void sendFile ( String file, OutputStream output ) {
try {
          FileInputStream input = new FileInputStream ( file );
int value = input.read();
while ( value != -1 ) {
output.write ( value );
value = input.read();
output.flush();
catch ( Exception ex ) {
*****Extract from Server.java******
if (incoming.equals("STOR"))
          String filename = iStream.readUTF(); //read in the string object (filename)
          InputStream in = projSock.getInputStream();
          handleFile ( in, filename ); //read in the file itself
     addLog("File successfully sent to server: " +filename);  //Record the send event in the log file
          System.out.println("Send Operation Successful: " + filename);
private static void handleFile ( InputStream input, String file ) {
try {
          FileOutputStream output = new FileOutputStream ( file );
int value = input.read();
while ( value != -1 ) {
output.write ( value );
value = input.read();
output.flush();
catch ( Exception ex ) {

Thanks for the advice. Have it working perfectly nowGlad it helped. You have no idea how refreshing it is that you didn't respond with, "Can you send me the code?" Nice to see there are still folk posting here who can figure out how to make things work with just a pointer or two...
Grant

Similar Messages

  • Upload File size limit when applying HTTPs on NES 4.0 SP1

    Hi,all
    I try to upload a file throgh a servlet,it works fine under HTTP,but when I apply Https protocol on my web application.The configuration is as fllowing:
    APP Server:WebLogic 5.1 SP 9
    Web Server:Netscape Enterprise Server 4.0 Sp1
    I found if the uploaded file size exceede 50K,the web server will encounter error and error message is as following:
    Unexpected Exception recieving data-5938
    I try to locate the problem,someone told me that the problem reside in Weblogic 5.1 plugin configuration,you should add somting in your obj.conf,but he neither figure out what the problem is.Anyone Help!!
    Any help and tips will be appricated
    cheng

    why not first try to upgrade to new versions of web server like 6.1 ? i don't think, sun officially supports 4.0 or 4.1 any more (at least 6 years old, if nore more )
    by upgrading , u will also get new security and better manageablitliy features as well.
    thanks
    sriram

  • OLM content management: is there an upload file size limit?

    Hello -
    I am wondering if anyone has encountered a limit on the size of a file uploaded as content for a learning object? I have one zip file that is about 225 MB and fails on the upload, after trying for some time, with this error:
    JSP Error:
    Request URI:/OA_HTML/OA.jsp
    Exception:
    java.lang.OutOfMemoryError: Java heap space
    I am successful uploading all other content objects, all of which are much smaller. I am using Oracle Learning Management 11.5.10.2. My workaround, successful, is to extract the zip file manually into the appropriate directory on the Learning Management content server.
    Steps to reproduce (standard):
    1. Create learning object
    2. Attempt to upload zip file
    Thank you for your help!

    Hi Dears,
    i'm facing the same issue on content server with IAS 10G
    would u please advise ?
    and please for the workaround to FTP the file to the respected directory i have done so but it didn't appear in OLM folder please elaborate.
    thanks
    Nabil

  • "the remote server returned an error (400) bad request." can't able to upload file size 1 MB

    I cant able to upload the file size >1 MB its showing error."the remote server returned an error (400) bad request."
    any one kindly help to fix the issue.

    Hi,
    Are you trying thru OOB or how..
    Please check the "maximum file size for sharepoint".
    refer below links for the same.
    https://angler.wordpress.com/2012/03/21/increase-the-sharepoint-2010-upload-file-size-limit/
    https://msdn.microsoft.com/en-us/library/ff487972.aspx
    Don't forget to mark it as an Answer if it resolves your problem or Vote Me if it useful.
    Mahesh

  • How can we limit uploading file size in portal.

    we have a feature where customers can upload there files, we use portals for uploading files, form which has the file type is posted to a stored procedure and which in turns calls the wwv_things.saveitem.
    we need to restrict a file size and file type for the uploading files, I can restrict the file type with javasript but wanted to find out if oracle portals has any way to restrict the uploading file size,
    thanks and regards,
    Sunil.

    Currently, this is not available. You could have a query that has all RKF as a starting point to achieve this. If you think this would be good to have by default, please log a development request on the OSS Messaging System.

  • Folio file size limit

    In the past their were file size limits for folios and folio resources. I believe folios and their resources could not go over 100MB.
    Is their a file size limit to a folio and its resources? What is the limit?
    What happens if the limit is exceeded?
    Dave

    Article size is currently capped at 2GB. We've seen individual articles of up to 750MB in size but as mentioned previously you do start bumping into timeout issues uploading content of that size. We're currently looking at implementing a maximum article size based on the practical limitations of upload and download times and timeout values being hit.
    This check will be applied at article creation time and you will not be allowed to create articles larger than our maximum size. Please note that we are working on architecture changes that will allow the creation of larger content but that will take some time to implement.
    Currently to get the best performance you should have all your content on your local machine (Not on a network drive), shut down any extra applications, get the fastest machine you can, with the most memory. The size of article is direclty proportional to the speed at which you can bundle an article and get it uploaded to the server.

  • WebUtil File Transfer - file size limit

    Does anybody know what the file size limit is if I want to transfer it from the client to the application server using WebUtil? The fileupload bean had a limit of 4 Mb.
    Anton Weindl

    Webutil is only supported for 10g. THe following is added to the release notes:
    When using Oracle Forms Webutil File transfer function, you must take into consideration performance and resources issues. The current implementation is that the size of the Forms application server process will increase in correlation with the size of the file that is being transferred. This, of course, has minimum impact with file sizes of tens or hundreds of kilobytes. However, transfers of tens or hundreds of megabytes will impact the server side process. This is currently tracked in bug 3151489.
    Note that current testing up to 150MB has shown no specific limits for transfers between the database and the client using WebUtil. Testing file transfers from the client to the application server has shown no specific limit up to 400Mb; however, a limit of 23Mb has been identified for application server to client file transfers.

  • CRIO FTP transfer file size limit

    Hi,
    I generated a data file on my cRIO that is about 2.1 GB in size. I'm having trouble transferring this file off of the cRIO using FTP. I've tried windows explorer FTP, the built in MAX file transfer utility, coreFTP,and WinSCP. I am able to transfer other files on the cRIO that are smaller in size.
    Is there an FTP transfer file size limit? Is it around 2 GB? Is there anything I can do to get this file off of the device?
    Thanks!
    Solved!
    Go to Solution.

    I am not making the FTP transfer programmatically through LabVIEW. Rather, I am trying to utilize the cRIO's onboard FTP server to make the file transfer using off the shelf Windows FTP file transfer applications. I generate the data file by sampling the cRIO's analog inputs and recording to the onboard drive. I transfer the file at some point after the fact; whenever is convenient.
    To program the cRIO, I am using LabVIEW 2012 SP1 and the corresponding versions of Real-Time and FPGA. I am using a cRIO-9025 controller and 9118 chassis.
    I do not get any error messages from any of the FTP clients I have tried besides a generic "file transfer failed".
    I have had no issues transferring files under 2 GB using FTP clients. I have tried up to 1.89 GB files. The problem seems to only appear when the file is greater than 2 GB in size.
    I have found some information elsewhere online that some versions of the common Apache web server do not support transferring files greater than 2 GB. Does anyone know what kind of FTP server the cRIO-9025 runs?

  • HT4863 How can I increase the file size limit for outgoing mail. I need to send a file that is 50MB?

    How can I increase the file size limit for outgoing mail. I need to send a file that is 50MB?

    You can't change it, and I suspect few email providers would allow a file that big.  Consider uploading it to a service like Dropbox, then email the link allowing the recipient to download it.

  • FILE and FTP Adapter file size limit

    Hi,
    Oracle SOA Suite ESB related:
    I see that there is a file size limit of 7MB for transferring using File and FTP adapter and that debatching can be used to overcome this issue. Also see that debatching can be done only for strucutred files.
    1) What can be done to transfer unstructured files larger than 7MB from one server to the other using FTP adapter?
    2) For structured files, could someone help me in debatching a file with the following structure.
    000|SEC-US-MF|1234|POPOC|679
    100|PO_226312|1234|7130667
    200|PO_226312|1234|Line_id_1
    300|Line_id_1|1234|Location_ID_1
    400|Location_ID_1|1234|Dist_ID_1
    100|PO_226355|1234|7136890
    200|PO_226355|1234|Line_id_2
    300|Line_id_2|1234|Location_ID_2
    400|Location_ID_2|1234|Dist_ID_2
    100|PO_226355|1234|7136890
    200|PO_226355|1234|Line_id_N
    300|Line_id_N|1234|Location_ID_N
    400|Location_ID_N|1234|Dist_ID_N
    999|SSS|1234|88|158
    I would need a the complete data in a single file at the destination for each file in the source. If there are as many number of files as the number of batches at the destination, I would need the file output file structure be as follows:
    000|SEC-US-MF|1234|POPOC|679
    100|PO_226312|1234|7130667
    200|PO_226312|1234|Line_id_1
    300|Line_id_1|1234|Location_ID_1
    400|Location_ID_1|1234|Dist_ID_1
    999|SSS|1234|88|158
    Thanks in advance,
    RV
    Edited by: user10236075 on May 25, 2009 4:12 PM
    Edited by: user10236075 on May 25, 2009 4:14 PM

    Ok Here are the steps
    1. Create an inbound file adapter as you normally would. The schema is opaque, set the polling as required.
    2. Create an outbound file adapter as you normally would, it doesn't really matter what xsd you use as you will modify the wsdl manually.
    3. Create a xsd that will read your file. This would typically be the xsd you would use for the inbound adapter. I call this address-csv.xsd.
    4. Create a xsd that is the desired output. This would typically be the xsd you would use for the outbound adapter. I have called this address-fixed-length.xsd. So I want to map csv to fixed length format.
    5. Create the xslt that will map between the 2 xsd. Do this in JDev, select the BPEL project, right-click -> New -> General -> XSL Map
    6. Edit the outbound file partner link wsdl, the the jca operations as the doc specifies, this is my example.
    <jca:binding  />
            <operation name="MoveWithXlate">
          <jca:operation
              InteractionSpec="oracle.tip.adapter.file.outbound.FileIoInteractionSpec"
              SourcePhysicalDirectory="foo1"
              SourceFileName="bar1"
              TargetPhysicalDirectory="C:\JDevOOW\jdev\FileIoOperationApps\MoveHugeFileWithXlate\out"
              TargetFileName="purchase_fixed.txt"
              SourceSchema="address-csv.xsd" 
              SourceSchemaRoot ="Root-Element"
              SourceType="native"
              TargetSchema="address-fixedLength.xsd" 
              TargetSchemaRoot ="Root-Element"
              TargetType="native"
              Xsl="addr1Toaddr2.xsl"
              Type="MOVE">
          </jca:operation> 7. Edit the outbound header to look as follows
        <types>
            <schema attributeFormDefault="qualified" elementFormDefault="qualified"
                    targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/file/"
                    xmlns="http://www.w3.org/2001/XMLSchema"
                    xmlns:FILEAPP="http://xmlns.oracle.com/pcbpel/adapter/file/">
                <element name="OutboundFileHeaderType">
                    <complexType>
                        <sequence>
                            <element name="fileName" type="string"/>
                            <element name="sourceDirectory" type="string"/>
                            <element name="sourceFileName" type="string"/>
                            <element name="targetDirectory" type="string"/>
                            <element name="targetFileName" type="string"/>                       
                        </sequence>
                    </complexType>
                </element> 
            </schema>
        </types>   8. the last trick is to have an assign between the inbound header to the outbound header partner link that copies the headers. You only need to copy the sourceDirectory and SourceGileName
        <assign name="Assign_Headers">
          <copy>
            <from variable="inboundHeader" part="inboundHeader"
                  query="/ns2:InboundFileHeaderType/ns2:fileName"/>
            <to variable="outboundHeader" part="outboundHeader"
                query="/ns2:OutboundFileHeaderType/ns2:sourceFileName"/>
          </copy>
          <copy>
            <from variable="inboundHeader" part="inboundHeader"
                  query="/ns2:InboundFileHeaderType/ns2:directory"/>
            <to variable="outboundHeader" part="outboundHeader"
                query="/ns2:OutboundFileHeaderType/ns2:sourceDirectory"/>
          </copy>
        </assign>you should be good to go. If you just want pass through then you don't need the native format set to opaque, with no XSLT
    cheers
    James

  • TFS Preview source control file size limit

    Is there a file size limit for adding large files to a TFS Preview project's source control..?   I would like to add some files to source control that are in the 20-30Mb range and the requests keep aborting.

    Hi Erich,
    Thank you for your post.
    I test the issue by adding .zip file to TFS Azure version comtrol, the size include 10MB, 20MB, 100MB, 2GB, i can add they to version control properly without any problem.
    In order narrow down the issue, here are some situations i want to clarify from you:
    1. What's the error message when TFS azure block the check-in process? Could you share a screen shot?
    2. Which client tool are you using? VS10 or VS11? Or other tools?
    3. Try to reproduce this in different network environment and see what will happen.
    4. Capture a fiddler trace which can help to check the issue.
    Thanks,
    Lily Wu [MSFT]
    MSDN Community Support | Feedback to us

  • Max Character File Size Limit exceeded.The document is too large to process

    Hi
    I have  made set on section on products in report.
    the Reports contains around 50 products when im opening the report
    in draft mode the following error is displayed
    "Max Character File Size Limit exceeded.The document is too large to be proceesed by the server .Contact your business Objects Administrator."
    can some body help me out how to increase my report character file size

    Hi,
      If you are using Business Objects XIR2, there is a performance parameter in the Web_Intelligence Report Server where you can increase the size of that file. The parameter is Maximun Character File Size. Go to the CMC>Server>server.Web_IntelligenceReportServer in the Properties tab you will see it.
    Cheers,
    Luigi

  • File size limit of 2gb on File Storage from Linux mount

    Hi!
    I setup a storage account and used the File Storage (preview). I have followed instructions at
    http://blogs.msdn.com/b/windowsazurestorage/archive/2014/05/12/introducing-microsoft-azure-file-service.aspx
    I created a CentOS 7 virtual server and mounted the system as
    mount -t cifs //MYSTORAGE.file.core.windows.net/MYSHARE /mnt/MYMOUNTPOINT -o vers=2.1,username=MYUSER,password=MYPASS,dir_mode=0777,file_mode=0777
    The problem is that I have a file size limit of 2gb on that mount. Not on other disks. 
    What am I doing wrong?

    Hi,
    I would suggest you check your steps with this video:
    http://channel9.msdn.com/Blogs/Open/Shared-storage-on-Linux-via-Azure-Files-Preview-Part-1, hope this could give you some tips.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • File size limit

    Hi All,
    I am just asking this question about the file size which we can upload to BI cubes . Is there any file size limitation for the same.
    I have not experienced any thing like this in past but just want to know incase anthing has been mentioned by SAP any where as I could not find any figure for the same.
    Secondly if there is a DB connect between a source system and SAP BI , is there any size consideration for data transfer .
    I tried to surf around and i have not experienced any thing such in the past .
    Will appreciate your replies
    Rahul

    Considering the new recommended specifications for video podcasts and Apple TV, will this file size limit be increased?

  • File Size Limit in Apache 2.2

    Dear Colleagues,
    Can I know the maximum file size limit for large file support in apache 2.2 ?
    Best Regards
    Deepak

    HI,
    Its Purely based on the Bandwidth and Server memory Capacity
    dont post all these in SAP Forum
    post relavent Questions
    SapSanthose

Maybe you are looking for

  • Window 8.1 rundll error

    Ive just updated from windows 8 to window 8.1 and i get this error that pop up more then 5 time after turn on my pc it said RunDLL There was a problrm starting C:\PROGRA~1\COMMON~1\System\SYSPLA~2.DLL The specified module could not be found. can some

  • VAT summary report of South Korea (RFUMSV45R) in ECC 6.0

    Dear all, is there someone who has some experience on the VAT reporting for Korea. We are doing a roll out in Korea and need some support. My question is about the submission of the electronic file available in RFUMSV45R. After comparing the output f

  • How do you load subReports in ReportViewer in remote processing mode using LoadReportDefinition

    We have a reportViewer control on a web page that renders reports in Remote ProcessingMode. However, it does not access the reports from the SSRS server, it loads them from our own repository, and sends the Stream of the RDL file to LoadReportDefinit

  • HOW DO I GET THE CODE? (Upgrade från CS 5.5 to 6.0)

    I am trying to install Adobe CS 6 on my computer. The installation goes fine until I enter my serialnumber. Then I get the message "The serial number is valid, but could not find a qualifying product on this computer." When I search on the Adobe site

  • Upgrade iOS6 to Iphone4 and cant activate cellular data network

    I have recently upgrade latest os to my iphone 4 & followings are problems im having now with my phone: 1. Map is not working 2. Cellular data network not working 3. Wifi is weak & cant get signal strength like previous os Appreciate if anyone can su