473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Upload File from Client to Server (not using HTMLInputFile)

Hello,

I am using asp.net. I have been searching this for a while, but dint
find any solution yet. Any help will be appreciated.

I have a string variable say 'myFile' that has complete path of a file
located in client machine. eg:
Dim myFile as string = "C:/myFolder/File1.txt"

Clicking on a button should copy that file from local client to a
location in the server.

I am familiar with 'HtmlInputFile', but the property 'PostedFile' is
readonly. I can not assign my 'myFile' variables value to it. I am not
using HTMLInputFile b'coz I dont want to store the file when I select
it after browsing. I am storing it in a string variable and later on
(in the end), I have to save/upload it in the server.

Thanks,
Chris

Jan 31 '07 #1
4 1921
hi chris
browsers implement very tight security when it comes to client file system
security.
as the developer you cannot decide which file the user will upload. and for
very good reason, imagine if you could retrieve my outlook PST file just
because i browsed to your site by mistake?
fortunately it is not possible to do what you asked. you may want to look
at a windows forms client which can be run with full access to the client
file system. if the user launches your app with full trust, then you can do
whatever you like with their files.

good luck
tim

"Chris" <ch***********@gmail.comwrote in message
news:11**********************@v45g2000cwv.googlegr oups.com...
Hello,

I am using asp.net. I have been searching this for a while, but dint
find any solution yet. Any help will be appreciated.

I have a string variable say 'myFile' that has complete path of a file
located in client machine. eg:
Dim myFile as string = "C:/myFolder/File1.txt"

Clicking on a button should copy that file from local client to a
location in the server.

I am familiar with 'HtmlInputFile', but the property 'PostedFile' is
readonly. I can not assign my 'myFile' variables value to it. I am not
using HTMLInputFile b'coz I dont want to store the file when I select
it after browsing. I am storing it in a string variable and later on
(in the end), I have to save/upload it in the server.

Thanks,
Chris
Jan 31 '07 #2
"Chris" <ch***********@gmail.comwrote in message
news:11**********************@v45g2000cwv.googlegr oups.com...
Clicking on a button should copy that file from local client to a
location in the server.
You must be joking!
I am familiar with 'HtmlInputFile', but the property 'PostedFile' is
readonly. I can not assign my 'myFile' variables value to it.
And a damn good thing too!!!
Jan 31 '07 #3
see previous reply. there is no way other than an active/x control. as
this control will be inherently unsafe, you probably can not find one to
buy, so you will have to build it.

also while this control could be written in .net, as its unsafe, the
user would have to mark it as trusted for it to be able to access the
file system.
-- bruce (sqlwork.com)
Chris wrote:
Hello,

I am using asp.net. I have been searching this for a while, but dint
find any solution yet. Any help will be appreciated.

I have a string variable say 'myFile' that has complete path of a file
located in client machine. eg:
Dim myFile as string = "C:/myFolder/File1.txt"

Clicking on a button should copy that file from local client to a
location in the server.

I am familiar with 'HtmlInputFile', but the property 'PostedFile' is
readonly. I can not assign my 'myFile' variables value to it. I am not
using HTMLInputFile b'coz I dont want to store the file when I select
it after browsing. I am storing it in a string variable and later on
(in the end), I have to save/upload it in the server.

Thanks,
Chris
Feb 1 '07 #4
On Jan 31, 5:19 pm, bruce barker <nos...@nospam.comwrote:
see previous reply. there is no way other than an active/x control. as
this control will be inherently unsafe, you probably can not find one to
buy, so you will have to build it.

also while this control could be written in .net, as its unsafe, the
user would have to mark it as trusted for it to be able to access the
file system.

-- bruce (sqlwork.com)

Chris wrote:
Hello,
I am using asp.net. I have been searching this for a while, but dint
find any solution yet. Any help will be appreciated.
I have a string variable say 'myFile' that has complete path of a file
located in client machine. eg:
Dim myFile as string = "C:/myFolder/File1.txt"
Clicking on a button should copy that file from local client to a
location in the server.
I am familiar with 'HtmlInputFile', but the property 'PostedFile' is
readonly. I can not assign my 'myFile' variables value to it. I am not
using HTMLInputFile b'coz I dont want to store the file when I select
it after browsing. I am storing it in a string variable and later on
(in the end), I have to save/upload it in the server.
Thanks,
Chris- Hide quoted text -

- Show quoted text -
That makes sense. I can not use windows application. It has to be web
app. I'll try something else.
Thanks for your help !! I appreciate it.

Feb 2 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Amar | last post by:
I am trying to upload a file to the webserver through my asp.net application. The file upload works fine for files below 50 MB size because i have set the maxrequestlength property of the...
5
by: Ariel Dolan | last post by:
Can I use HtmlInputFile to only get the selected file name but not actually upload the file? Clicking the control's Browse button let's the user select a file. All I need is the HtmlInputFile...
1
by: TK | last post by:
I have a file upload control to allow a user to select/upload a file to the server. They need to upload x number of files in one shot because they have to confirm that they are uploading x number...
3
by: Beatrice | last post by:
I am stuck with this problem and desperately need your help. I would like to upload an xml file or any file from client machine and then save it to the server machine. Since the file path on the...
3
by: Jeff S | last post by:
I'm enabling users to upload files to the server. I'd like to show them some indication of percent complete. How can this be done? Thanks!
4
by: psb | last post by:
I have a file upload Web page using System.Web.UI.HtmlControls.HtmlInputFile. Anyone have any issues uploading files using MacOS browsers of any sort?? Almost all of them bomb on our server. Is...
8
by: Braky Wacky | last post by:
Hello, I have an ASP.NET webpage that uses an instance of System.Web.UI.HtmlControls.HtmlInputFile for uploading files to our server. I came across the documentation at MSDN for upping the...
10
by: Brian Henry | last post by:
Hi, I am having a problem with an attachment system I made... it works with files up to ~3MB in size then after that if you try to upload a file it just goes to a "Page can not be displayed" page...
4
by: jf li | last post by:
I have a Asp.net web application and a Asp.net Web service application. The Web application is using HtmlInputFile to get a 50M size of file selected by end user, read the data of this file and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.