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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:11:36+00:00 2026-06-10T08:11:36+00:00

I have a web page with links pointing to downloadable files. For example: http://www.mysite.com/download.php?FILE=downloads/programming/various/ebook.pdf

  • 0

I have a web page with links pointing to downloadable files. For example:

http://www.mysite.com/download.php?FILE=downloads/programming/various/ebook.pdf

But it can also have navigation links as follows:

http://www.mysite.com/index.php

http://www.mysite.com/index.php?category=programming

http://www.mysite.com/index.php?section=programming&category=various

How can I determine if a URL is pointing to a file as in the first link ? Or inversely, filter out URLs which don’t fit ?

  • 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-10T08:11:38+00:00Added an answer on June 10, 2026 at 8:11 am

    Going with your edited question: if you want to filter out files,

    screen the Content-Type header.

    Here is an informal list of common mime-types

    You can inspect response headers to determine if the response will conform, e.g. to an application/pdf But you cannot, just from the URL / URI itself, make this determination.

    In fact, I could construct a web application that would respond to the URL http://myapp.com/test.pdf with header Content-Type: image/jpeg and data of a JPG.

    Also, I could really break things by sending a header Content-Type: image/jpeg and data of for a PDF.


    Presuming that it wasn’t intentionally-broken (as I mentioned above) then you can rely on the response.

    Be aware if the content itself deviates from the Content-Type header then you could have an exploit happen. This is how the iPhone was jailbroken: through acting on malformed PDF data.

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

Sidebar

Related Questions

I have a web page that links to another web application, which unfortunately only
I have a web page with a bunch of links. I want to write
We have a Web application (ASP.NET) which displays in some page links to miscellaneous
I have the following links at the top of my web page: <ul class=icyLink>
I have a Spring 3.0.x web project that is displaying a page of links
I have web page in PHP which displays all records in a table. I
I have a web page with 3 links. 1 of the links is hidden
Currently, I have an asp.net web application that links to another page. The enduser
I have a web page which links to an Excel 2007 worksheet. It is
Hello! I have this script: URL = http://www.hitmeister.de/ page = urllib2.urlopen(URL).read() soup = BeautifulSoup(page)

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.