Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 29th, 2005, 07:19 AM
Registered User
Join Date: Apr 2005
Location: delhi, delhi, India.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ruchilalla
Default unable to restrict uploaded file to xml

tried adding the script but not getting the desired result
sending in my jsp file

<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="netui-tags-databinding.tld" prefix="netui-data"%>
<%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
<%@ taglib uri="netui-tags-template.tld" prefix="netui-template"%>
            Web Application Page



       <FORM NAME="myForm"
   <INPUT type="file" name="myFile1" accept="text/xml" >

   <INPUT TYPE="submit" VALUE="Upload File" onclick="">
plz tellme how to go about restricting the uploaded file to xml

Reply With Quote
  #2 (permalink)  
Old July 14th, 2005, 01:38 AM
Authorized User
Join Date: May 2005
Location: bangalore, karnataka, India.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to meetnaveen4u

I think we can even restrict the type of files to be uploaded in the servlet also, instead of accept="text/xml".

Thanks and Regards
Reply With Quote
  #3 (permalink)  
Old July 14th, 2005, 04:06 AM
Authorized User
Join Date: Mar 2005
Location: Pune, Maharashtra, India.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to dadahonde Send a message via Yahoo to dadahonde

Check the file type you received for uploading.
Compare this file type with xml file type before uploading it.
The XML file types are identified like text/xml , text/XML

We used to do it this way only..


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get Path of uploaded file in JSP murulikblr JSP Basics 0 April 17th, 2007 02:05 AM
Unable to send Email using Uploaded Application hellowahab .NET Framework 1.x 2 February 1st, 2007 05:08 AM
deleting a file after it is been uploaded yts007 Dreamweaver (all versions) 1 August 16th, 2006 01:05 AM
Read an uploaded Excel File rekha_jsr Classic ASP Basics 0 June 12th, 2005 10:17 PM
restrict the uploaded file to ACCEPT ONLY XML FIL ruchilalla J2EE 3 April 29th, 2005 07:19 AM

All times are GMT -4. The time now is 05:46 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.