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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:43:15+00:00 2026-06-15T22:43:15+00:00

I have set up a simple servlet meant to be used as a file

  • 0

I have set up a simple servlet meant to be used as a file server. I am using Weblogic 10.3.2 as the containter.

I want to process PUT request, so I implemented the doPut method. Since it is a PUT request, I expect to find in the header the name of the file I pushed to the server.

I push a file named test.txt containing “Hello World”.

curl -T test.txt http://xxxxxxx:71xxx

Using curl and netcat, here is the request.

PUT /test.txt HTTP/1.1
User-Agent: curl/7.19.0 (x86_64-suse-linux-gnu) libcurl/7.21.2 OpenSSL/0.9.8h zlib/1.2.3
Host: xxxxxxxxx:71xx
Accept: */*
Content-Length: 12
Expect: 100-continue

Hello World

Using the servlet and weblogic 10.3.2, here is the HTTPServletRequest.
This is what I get when I stopped in the doPut method printing the HTTPServletRequest java object, after sending the curl command.

weblogic.servlet.internal.ServletRequestImpl@17d11f0[
PUT /WebServer/FileServlet HTTP/1.1
User-Agent: curl/7.19.0 (x86_64-suse-linux-gnu) libcurl/7.21.2 OpenSSL/0.9.8h zlib/1.2.3
Accept: */*
Content-Length: 12
Expect: 100-continue

]

If I process the inputstream of the HTTPServletRequest, I get the content of my file, but lose the filename.

Is there a way to get the original filename in the HTTPServletRequest?
Could you explain me what happened?

EDIT: Actually what I do not understand is why the requestURL and requestURI changes and reflects the servlet mapping and not the original information?

  • 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-15T22:43:16+00:00Added an answer on June 15, 2026 at 10:43 pm

    The filename is not passed as a part of the file. (So, if you were uploading as a POST from a webpage with a file input named “bodyOnly” you would get the file name from the “bodyOnly” parameter)

    So you will have to find another way of passing the filename – perhaps the appropriate way is to have your server handles urls along the lines of

    http://xxxxxxx:71xxx/[filename]
    

    so you upload the file with

    curl -T test.txt http://xxxxxxx:71xxx/test.txt
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple .htaccess file set up to redirect a 404 to
hi i am using django app engine patch i have set up a simple
I have a set of simple shapes (see following figure), and I want to
I try to do a simple file upload to server using apache.fileupload. I tried
I set up a simple Servlet for interacting with my Android app using C2DM.
I have a set of relatively simple electrical circuits. Small ones involving just resistors,
I have set up a few models in a simple django project. When I
I have a simple fabric.canvas element which has a background and I have set
What I am trying to do: I have a simple set union function in
I have a fairly simple set of functionality for which I have multiple implementations,

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.