Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 January 28th, 2007, 12:36 AM
Registered User
 
Join Date: Sep 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default strange file upload problem

i have a web page that allows you to upload a file to the server.
if i upload a word document so the sever, then modify the original document and try to upload it again, the file overwrite fails.
does anybody know why.

if i do the same with either a text file or pdf file, the
file overwrite succeeds.

here is the code i am using

<%@ Control Language="vb" Inherits="dannet.uploadfile" %>
<%@ Import namespace = "System.IO" %>

    <script runat =server >





public sub upload_click (obj as object , e as eventargs )

      If Not (uploadedFile.PostedFile Is Nothing) Then


                Try

                    dim filepathname as string
                    filepathname = "./docs/" & filename
                    message.text = filepathname
                    postedFile.SaveAs(server.mapPath("./docs/") & filename)


                        Catch exc As Exception
                        message.Text = "Failed uploading file"
                End Try

    end if

    end sub


    </script>


        <table>
        <tr><td>

                        Select File to Upload: <input id="uploadedFile" size="60" type="file" runat="server" NAME="uploadedFile">
                        <Input Type="submit" Value="Upload" OnServerClick="Upload_Click" RunAt="Server" ID="uploaddoc" >



         </td></tr>
         <tr><td><asp:Label ID = message text = "" Runat = server />

         </td></tr>
        </table>






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem to upload file imjigu2001 ASP.NET 2.0 Professional 2 March 26th, 2008 04:37 AM
File Upload Problem meetravig Pro JSP 0 July 14th, 2007 01:34 AM
Strange Upload Issue Elenesski ASP.NET 1.0 and 1.1 Professional 2 April 8th, 2007 11:26 PM
File upload problem! Ashleek007 Beginning PHP 0 July 15th, 2005 11:08 AM





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