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 7756377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:48:24+00:00 2026-06-01T12:48:24+00:00

I am looking for the best way to upload the XML file to the

  • 0

I am looking for the best way to upload the XML file to the GAE DataStore from the web page. The XML will be later parsed and modified wia the web interface. So far I am using the HTMLform with file typeinput:

<form enctype="multipart/form-data" action="update" method="post" > 
  <input type="file" name="myfile" /> 
  <input type="submit" /> 
</form>

In the servlet class I use the for loop to read the data into String:

InputStream input = req.getInputStream();
StringBuffer sb = new StringBuffer(""); 

int c = -1;
while ( (c = input.read() ) != -1 ) 
{
  char ch = (char) c;
  sb.append( ch );
}

Then I check if the DataStore contains the entity with application hardcoded key value and if not I create a new entity and upload the XML into Text (com.google.appengine.api.datastore.Text), otherwise I create a new entity and put the file there. Is that something you can call the good approach?

Regards,
STeN

  • 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-06-01T12:48:26+00:00Added an answer on June 1, 2026 at 12:48 pm

    If you use a html form with type="file" field, then browser will upload the file via http POST with a multipart/form-data content type.

    See AppEngine docs on how to handle properly multipart content data.

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

Sidebar

Related Questions

I'm looking for best way to initiate call from a web page, and am
I'm looking for the best way to select numbers directly from an in clause.
I'm looking for a way to allow a user to upload a large file
I am looking for a best way to trigger windows application automation from Java
I'm looking for the best way to take a datetime string from MySQL, explode
I'm currently looking at the best way to upload an image to my existing
What is the best way to validate the file format in file-upload control in
I'm looking for a way to display a file or image on another page
I'm looking for best way of using session within zf application. At first I
Looking for the best way to set-up an iPhone project in XCode ... namely:

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.