Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 610171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:38:46+00:00 2026-05-13T17:38:46+00:00

I need to upload a file in GWT in the background, ie. not from

  • 0

I need to upload a file in GWT in the background, ie. not from a visual widget.

For this I’ve found the RequestBuilder class, but little documentation on how to use it for upload purposes.

The file content I need to upload is 100% plaintext.

My code so far looks like this:

final String filename = UUID.randomUUID().toString() + ".txt";

RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, "http://localhost/upload");
rb.setRequestData(selected.getBody()); // getBody() is plain-text
rb.setHeader("Content-Type", "application/x-www-form-urlencodeddata");
rb.setCallback(new RequestCallback() {
    @Override
    public void onResponseReceived(Request request, Response response) {
        w.setUrl("http://localhost/magic.html?hide=status&open=" + filename);
        w.show();
        w.maximize();                            
    }

    @Override
    public void onError(Request request, Throwable exception) {
        exception.printStackTrace();
    }
});

// Checked Exceptions sucks *sigh*
try {
    rb.send();
}
catch (RequestException e) {
    e.printStackTrace();
}

I hope someone can give me some pointers towards solving this issue, thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:38:46+00:00Added an answer on May 13, 2026 at 5:38 pm

    I think it’s not possible to upload files to the server without user interaction using JavaScript only. I think it’s blocked by the browser, because it would mean anybody could upload any file from your system when you visit a site, which would be a major security problem. I don’t know why you would want to do this, but I guess you need to look at another approach to what you are trying to do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to style the browse button of file upload in GWT.... I found
I need to continuously upload a generated file from Azure to client's FTP but
I'm writing GWT application where I need to upload video file and encode that
I need to upload a file from the client to an asp.net page. The
I need to upload .dat file from jsp page. I am using struts. I
I need to upload a xml file from server side, where the contents of
I need to upload my app file through Application Loader 2.7. But first I
i need to upload file with jquery. i now about uploadify plugin, but i
In my web application I need to upload file to the server. This file
I am new to GWT. I am trying to Upload a file. I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.