Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design 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 May 10th, 2005, 12:01 AM
Authorized User
 
Join Date: Jul 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem About Uploading Vidio FIle

Dear Asp Expert
              I tried uploading file with these lines of code
 .............
string srcfile=file1.PostedFile.FileName;
string desfile=Server.MapPath(@"./picture/"+txtTarget.Text);
file1.PostedFile.SaveAs(desfile);
................
         It worked well with all picture , text,pdf file but it didn't work with the .avi file .With the error message show that the server may encounter some difficulties.
          I tried the other way like this
..................
          string srcfile=@"d:/myvidio.avi";
          string descfile=Server.mapPath(@"./picture/"+txtTarget.Text);
           WebClient wc=new WebClient();
          wc.UpLoadFile(desfile,"POST",srcfile);
          wc.dispose();
.....................
           The file could be uploaded but could not open with windows media player .The error message show that it doesn't know the format of the file.
            What should I do next.Please tell me. thanks








 
Old May 10th, 2005, 03:07 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What is the value of txtTarget.Text when you save the file?
The browser will understand many image formats automatically by the binary contents of the file. I'm not sure about PDF (unless the extension is specified).

After the file is uploaded is the file extension of the uploaded video "avi"? If so, then the client should be able to handle it whether the browser can play/show it or it can hand off the downloaded file to the appropriate helper application (media player). If not, then that's probably the problem.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Uploading File misskaos Classic ASP Basics 4 October 26th, 2006 02:56 PM
Problem inserting blob data/uploading file - MySQL kyle_shea Beginning PHP 2 February 15th, 2005 10:18 AM
File Uploading problem in Win XP rafatrock Beginning PHP 2 December 29th, 2004 02:58 PM
uploading file problem lpastor ASP.NET 1.x and 2.0 Application Design 2 September 15th, 2004 08:12 AM
uploading file problem lpastor ASP.NET 1.0 and 1.1 Professional 1 September 15th, 2004 08:00 AM





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