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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:01:04+00:00 2026-05-31T07:01:04+00:00

I’m using google app engine to develop an upload form to upload a csv

  • 0

I’m using google app engine to develop an upload form to upload a csv file.
The issue I’m currently having is that in a Development environment the request action is to being sent correctly.

In the production environment the request action seems to work although the action is the same for both forms.

E.g.

Development

   action="http://localhost:8080/_ah/upload/ag50cy1zY2gtcmVwb3J0c3IbCxIVX19CbG9iVXBsb2FkU2Vzc2lvbl9fGAEM"

Production action:

    action="http://website.appspot.com/_ah/upload/AMmfu6Yer2BJaT_tW_fmc- PKvHaOHD3pnv5QH6o6d8XQQujbCWg5egbjf2sGxP5_cN6uAyvgDVOn8U40wLLXEvoQcrMDbHQQByJpTlamzBPz_8x8LN2UWKM/ALBNUaYAAAAAT1EmxMkvj7tiS9WAvYAWKPG1sN1DvmMk/"

When I investigate within the logs, the development server states the action is:
“/ag50cy1zY2gtcmVwb3J0c3IbCxIVX19CbG9iVXBsb2FkU2Vzc2lvbl9fGAEM”

Where as the Production logs state the action is:
“/form” (as expected)

The code for both is the same underneath as follows.

file: upload.jsp

    <%
               request.getAttribute("message");

                BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
            %>

            <hr/>
            <p>Upload a .csv file to the system.</p>
            <fieldset>
                <legend>Upload File</legend>
                <form action="<%= blobstoreService.createUploadUrl("/upload/form") %>" method="post" enctype="multipart/form-data">
                    <label for="filename_1">File: </label>
                    <input id="filename_1" type="file" id="filename_1" name="file" size="30" onchange="checkInput();" /><br/>
                    <br/>
                    <input type="submit" id="submitBtn" value="Upload File" />
                </form>
            </fieldset>

file: controller.java

    else if (action.equals("/form")) {
            Logger.getLogger(Controller3.class.getName()).log(Level.INFO, action);

            Map<String, List<BlobKey>> blobs = blobstoreService.getUploads(request);
            List<BlobKey> bkList = blobs.get("filename_1");
            BlobKey blobKey = bkList.get(0);

            if (blobKey == null) {
                Logger.getLogger(Controller3.class.getName()).log(Level.WARNING, "Blob null");
                response.sendRedirect("/");
            } else {
                Logger.getLogger(Controller3.class.getName()).log(Level.WARNING, "Blob not null");
                FileService fileService = FileServiceFactory.getFileService();

                // Create a new Blob file with mime-type "text/plain"
                AppEngineFile file = fileService.getBlobFile(blobKey);// Again, different standard Java ways of reading from the channel.
                FileReadChannel readChannel = fileService.openReadChannel(file, false);
                Reader reader1 = new BufferedReader(Channels.newReader(readChannel, "UTF8"));

                char c = ',';
                CSVReader reader = new CSVReader(reader1, c);

                ArrayList<ArrayList<String>> results = reader.getResults();
                ArrayList<String> columns = reader.getColumns();

                request.setAttribute("maxColumns", columns);
                request.setAttribute("csvResults", results);

                //Remove the CSV file from the blobstore now we have used it.
                blobstoreService.delete(blobKey);
                this.getServletContext().setAttribute("csvUploadResults", results);
            }

The web.xml has been setup to to deal with the requests:
/_ah/upload/, /upload/, /_ah/upload/upload/*

I’m hoping there is a simple explaination (there probably is) why the code works in production but not in development.

Any assistance will be of great help.

  • 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-31T07:01:05+00:00Added an answer on May 31, 2026 at 7:01 am

    I’m currently wrestling with the Blobstore too.

    I note you said:
    The web.xml has been setup to to deal with the requests: /_ah/upload/, /upload/, /_ah/upload/upload/*

    But note that AFTER the blobstore has handled the request to add your blob (by posting to the URL you got createUploadUrl(“/upload”) ) Then it will call YOUR method mapped to “/upload” in web.xml. So you definitely want to remove any web.xml references to /_ah/upload/ as that is what the blobstore will intercept.

    I did that for a while and was getting a server error 500 with no logging whatsoever.

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I am using Paperclip to handle profile photo uploads in my app. They upload
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have just tried to save a simple *.rtf file with some websites and

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.