Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 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 July 6th, 2007, 02:49 AM
Registered User
 
Join Date: Apr 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Path taken from remote server

Hello
 I have a requirement to store a file(.htm/.jpg/.bmp) from my local machine to the database.I use fileupload control to browse and get the path of the file and save the contents of the document in the database on button click event.
 It works fine at my local machine. But when i hosted at remote server. It searches for the file at the remote server rather than my machine.For example: If select a file from E:\sample.htm it prompts with the error that
"Could not find the file specified in the path"E:\sample.htm"
 Would anyone help me to overcome this?

Thanks in Advance.
Regards,
Sripa.

 
Old July 6th, 2007, 02:14 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

The file upload control is not designed to provide you with the *path* of the file, but with the file itself. Obviously, the path is only good on the machine from with you upload.

If filUpload is the name of the upload control, then you should be able to get the file from here:

    filUpload.FileBytes as a byte array
or
    filUpload.FileContent as a System.IO.Stream

-Peter
 
Old July 6th, 2007, 11:57 PM
Registered User
 
Join Date: Apr 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank u so much. It works fine just by using its FIleBytes property.

Regards,
Sripa.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Path to a server on LAN gobotsoup ASP.NET 2.0 Basics 2 February 27th, 2007 10:10 PM
server error when uploading to remote server ammweb ASP.NET 1.0 and 1.1 Basics 7 July 30th, 2006 01:51 AM
VB Express and SQL server on remote server questio HoosierDaddy61 Visual Basic 2005 Basics 0 February 22nd, 2006 11:27 AM
connecting web server and remote db server via asp moreyt Classic ASP Databases 0 May 31st, 2005 12:13 AM
Linking Remote Sql Server with Web server yeetesh Pro VB Databases 1 May 26th, 2005 04:13 AM





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