Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2008

Tip: Looking for answers? Try searching our database.

Web File Validation

Thread view: 
Chase Preuninger - 06 Jan 2008 16:02 GMT
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 - 06 Jan 2008 16:05 GMT
Sorry I guess html dosent work.
Jeff Higgins - 06 Jan 2008 17:06 GMT
>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
Roedy Green - 07 Jan 2008 12:19 GMT
On Sun, 6 Jan 2008 08:02:54 -0800 (PST), Chase Preuninger
<chasepreuninger@gmail.com> 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.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Chase Preuninger - 08 Jan 2008 00:47 GMT
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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.