Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
|
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
 
Old April 29th, 2005, 07:19 AM
Registered User
 
Join Date: Apr 2005
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"%>
<netui:html>
    <head>
        <title>
            Web Application Page
        </title>

    </head>

     <body>


       <FORM NAME="myForm"
   ACTION="http://localhost:7008/IntgAppWeb/fwdservlet"
   ENCTYPE="multipart/form-data"
   METHOD="post">
   <INPUT type="file" name="myFile1" accept="text/xml" >

   <INPUT TYPE="submit" VALUE="Upload File" onclick="">
</FORM>
    </body>
</netui:html>
plz tellme how to go about restricting the uploaded file to xml

 
Old July 14th, 2005, 01:38 AM
Authorized User
 
Join Date: May 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to meetnaveen4u
Default

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
Naveen.
 
Old July 14th, 2005, 04:06 AM
Authorized User
 
Join Date: Mar 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to dadahonde Send a message via Yahoo to dadahonde
Default

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..

Regards
Dadasaheb..






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





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