Web File Validation

Discussion in 'Java' started by Chase Preuninger, Jan 6, 2008.

  1. I want users to give me the url to a file on he web other than html,
    htm, jsp, asp, etc. Then I need to validate that it exists, and then I
    need to make sure that it is <i>someName<b>.</b>someType</i>. any
    Ideas???
     
    Chase Preuninger, Jan 6, 2008
    #1
    1. Advertising

  2. Sorry I guess html dosent work.
     
    Chase Preuninger, Jan 6, 2008
    #2
    1. Advertising

  3. Chase Preuninger

    Jeff Higgins Guest

    Chase Preuninger wrote:
    >I want users to give me the url to a file on he web other than html,
    > htm, jsp, asp, etc. Then I need to validate that it exists, and then I
    > need to make sure that it is <i>someName<b>.</b>someType</i>. any
    > Ideas???


    Politely ask within your group of users for a URL to a file
    (other than html, htm, jsp, asp, etc.) on 'he web'.

    <http://java.sun.com/docs/books/tutorialNB/download/tutorial.zip>

    If you mean to say the Internet rather than 'he web' then see:

    The Java Tutorial - Custom Networking Trail
    <http://java.sun.com/docs/books/tutorial/networking/TOC.html>
    in particular the Working with URLs section,
    <http://java.sun.com/docs/books/tutorial/networking/urls/index.html>
    and its' subsection Parsing a URL.
    http://java.sun.com/docs/books/tutorial/networking/urls/urlInfo.html
     
    Jeff Higgins, Jan 6, 2008
    #3
  4. Chase Preuninger

    Roedy Green Guest

    On Sun, 6 Jan 2008 08:02:54 -0800 (PST), Chase Preuninger
    <> wrote, quoted or indirectly quoted someone
    who said :

    >I want users to give me the url to a file on he web other than html,
    >htm, jsp, asp, etc. Then I need to validate that it exists, and then I
    >need to make sure that it is <i>someName<b>.</b>someType</i>. any
    >Ideas???


    try downloading the file with a GET and aborting. You can also try a
    HTTP HEAD, though I suspect some websites will not let you do that.
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Jan 7, 2008
    #4
  5. I have been designing a web site where the users basically enter a
    file and I will index it in my database. I need to make sure the file
    exists, and that the file has a valid extension, and that it is a
    valid type. The reason I need to validate it is because it do not
    actually upload the file; I just create a link to it on my site.

    IE. www.google.com is invalid.
    www.google.com/file.exe is valid.
     
    Chase Preuninger, Jan 8, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Colin Mackay
    Replies:
    0
    Views:
    2,713
    Colin Mackay
    Jun 25, 2003
  2. Libs
    Replies:
    0
    Views:
    1,540
  3. Colin Basterfield

    Web form validation vs object validation

    Colin Basterfield, Nov 28, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    440
    Tommy
    Nov 29, 2003
  4. Matt
    Replies:
    14
    Views:
    4,175
    Chad Z. Hower aka Kudzu
    Jan 30, 2004
  5. Lucas Tam
    Replies:
    2
    Views:
    1,139
    Lucas Tam
    Feb 26, 2004
Loading...

Share This Page