URL fetch request size in googleaapengine - java

I am doing a web application project using GWT in Eclipse.
I have a file on the client side which is to send on the project.server and from server to external Repository.
File
|
V
Client-->Server-->Repository
Iam Using default SDk - (appengine-java-sdk-1.6.3.1- 1.6.3)
GWT-2.4.0
according to documentation googleappengine , the limit for URL fetch request is 5Mb.
** But I cannot fetch the request more then 3.8Mb **
If i try to fetch more then 3.8 Mb then it gives me an Error.
Cannot access http://URL: The request to API call urlfetch.Fetch() was too large.
Can somebody explain me the reason for this.
Even i have to download the file from repository and save it on client side.
So is there any limitaion of size to getContent of the file present in the Repository to the server Side.

If it's a binary file being sent over HTTP, it's probably being encoded as base64 before being transfered. That adds about 33% to the file size.
http://en.wikipedia.org/wiki/Base64

Related

Jmeter File upload Scenario - Issue PUT with body

I have a jmeter scenario where I need to upload a txt file of different size . To upload the file in jmeter , we enable multipart and request is of PUT type.
I am also getting put body , which is creating issue in my log files in the backend . Posting a sample request body . Is there any way where we can just send data without any data showing up under put data .
According to your screenshot you're trying to upload a file to http://www.csm-testcenter.org/test page, the page assumes HTTP POST method, not PUT.
If you're uncertain regarding proper JMeter configuration when it comes to uploading files be informed that you can just record the file upload event using your favourite browser (or another application) and JMeter's HTTP(S) Test Script Recorder. All you need to do is to copy the file to "bin" folder of your JMeter installation, this way JMeter will be able to properly capture the request and generate the relevant HTTP Request sampler and HTTP Header Manager.
More information: Recording File Uploads with JMeter

Google Cloud Platform load balancer aborts large file upload requests

When uploading (multipart post) file which is by underlying backend application (tomcat using apache fileupload library) considered as too large and responded with 413 http status, original request is aborted on load balancer with "aborted_request_due_to_backend_early_response" status. This means that user is presented with some built-in system error page instead of application error page.
How should the system be configured to deliver application error response to end user through load-balancer?
Some other details:
when the limit is, for example, 2MB, and the uploaded file is ~5MB, everything works fine, but when the file is >6MB described behaviour occurs (this depends on user's connection quality)
tomcat's / servlet's maxPostSize maxFileSize ... does not make any change
returning 200 instead of 413 does not make any change
I assume, that the response is (for those large ~6MB files) returned back before the file itself has been fully uploaded yet. But that is desired as I don't want to process, say, some gigabyte-large files into filesystem, and return 413 response afterwards - I want to cut them before any processing other than detecting their size.
So how to accomplish this in GCP (load balancer - apache - tomcat) environment?

Secure way to store client information and send back to client - java spring mvc

I am developing web service for a mobile application.As a part of this, I need to create some confidential reports and store it in the server and send it back to client on request as links (from which the file can be downloaded) . The requirement is , they should be able to open and view the documents in mobile.
If I have to send the file links, I should be having it in a web application which provides a public url . But does that make the reports secure ?
Can I send it as multipart file instead of url? In that case the problem is hybrid (phonegap ) platform cannot directly access the files. Is there any way to do it on phonegap?
If I use any encryption technique , may be like encrypting the url , the actual url can still be seen from the browser which opens inline .
Can anyone suggest a effective way to do send confidential documents to mobile ?
You can try creating and storing the report structure in PDF format on the server. Most browsers on mobile open up pdf files directly within the browser.
Since these are PDF files, you can password protect these and only clients who know the password can view the files.
Alternatively you can have a login filter, so that whenever a client hits your web service, he first enters some valid credentials to gain access to the document.
Encrypting the URL gives no benefit as the resource you intend to secure is the information in the document served back to the client.

SOAP Web Service - Java Server - iOS Client - SudzC send or receive large files

My system:
Server: Java Soap Web Service generated by JAX WS 2.2.3 (-wsgen)
Client: iOS - Soap Web Service generated by SudzC
I am using SudzC on iOS to communicate with a Java web service. I want to upload NSData files from the iOS client to the Java Server or download byte[] files from the Java server to the client. For small amounts of data the web service runs fine, but when the data is greater than 4MB, there are problems. If i send a file which is greater than 4MB a HTTP Internal Error 500 occurred or everything get stuck and my application crashes.
Any suggestions? Perhaps, should I try something else than SudzC?
I know, that to send and receive large files, SOAP has an opportunity called MTOM.
This extracts the base64Binary data from the SOAP message and packages it as separate binary http attachments within the MIME message, in a similar manner to e-mail attachments.
So my problem is, how can i implement this option on the iOS client SudzC generated objective-C program code?
On the java server side the MTOM option is activated, but on the iOS client i have to implement this option?!
Perhaps someone can help?
I use WSClient++ to generate the classes and never had a problem.
http://wsclient.neurospeech.com/
I don't like SudzC, I have any problems when XML return has list of list.
I've used SudzC to upload larger files (20 + megabytes) so the issue probably isn't from SudzC. I remember having an issue with the file upload at the beginning aswell : the server didn't accept anything over X bytes and was returning an error.
However, what i have seen is that sudzC has a lot of issues with memory when uploading large files so i switched to wsdl2objc for file upload

I want to copy an excel file from one location to other URL server location

I want to copy/move an Excel from local machine/given path to Server location.
The server location , we manually uploads the Excel file but i want to do it autmatically by using Java files.Can i do it , if so please give me a suggestion on it.
How do we skip those uploading mechanism which we do manually.
thanks in advance
VSRK
If you upload it via a web form, you can use Apache HttpClient to programmatically create the request sent to the server and upload the file. You will need to handle by yourself any authentication needed before the upload, store any cookies the server sends you, and do any post-authentication navigation the web page requires. You will also need to recreate the upload request exactly as the web browser sends it, parameters and all.

Categories