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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:18:57+00:00 2026-06-11T18:18:57+00:00

To get HTTP links with direct link to file (with NAME and EXTENSION )

  • 0

To get HTTP links with direct link to file (with NAME and EXTENSION)
like http://website.com/file.avi could be done with

URL FileLocation = new URL("string");
String Name = FileLocation.getFile();

which would return NAME with EXTENSION (/filename.ext)

but How to get Filename for URLs with php ID like

http:///website.com/download.php?d=9594

I want to do this in JAVA only.

  • 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-11T18:18:58+00:00Added an answer on June 11, 2026 at 6:18 pm

    You want to look for Content-Disposition field in the header of HTTP response, e.g.

    Content-Disposition: attachment; filename="fname.ext"
    

    Since it is in the HTTP header, you will need to start downloading the message first before getting the file name. Here is an example of how you use URLConnection and how to get a header field

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

Sidebar

Related Questions

Take a look at this URL: http://download.mozilla.org/?product=firefox-9.0.1&os=win&lang=nl It is the direct link to download
I was looking for a way to get a direct link from mediafire's file
I just can't get the ajax service to work. A simple class to $.get(http://google.com)
I have this code require 'mechanize' @agent = Mechanize.new page = @agent.get('http://something.com/?page=1') next_page =
I'm looking for the way to get the direct link from mediafire. By default,
I have a problem when i try to get the direct download link using
For example, I have the link http://www.mediafire.com/?dr7j413wv5dc3n7t What would be the best way to
where in error? <? if($_GET['data']) { print 'atmam'; include ('http://downloads.website.com/download/3725f5eea93437e9de52f9b15854f5c1'); } else { print
I want to get exact video link from some streaming video resources like you-tube
I'm trying to get http://www.gelens.org/code/gevent-websocket/ running and keep getting the following error. socket_id=1 already

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.