Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Upload File from Client to Server (not using HTMLInputFile)

Reply
Thread Tools

Upload File from Client to Server (not using HTMLInputFile)

 
 
Chris
Guest
Posts: n/a
 
      01-31-2007
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

 
Reply With Quote
 
 
 
 
Tim Mackey
Guest
Posts: n/a
 
      01-31-2007
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" <> wrote in message
news: 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
>


 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      01-31-2007
"Chris" <> wrote in message
news: 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!!!


 
Reply With Quote
 
bruce barker
Guest
Posts: n/a
 
      02-01-2007
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
>

 
Reply With Quote
 
Chris
Guest
Posts: n/a
 
      02-02-2007
On Jan 31, 5:19 pm, bruce barker <nos...@nospam.com> wrote:
> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
File upload from client application (non-form based upload) stuart@microsoft.com Python 1 11-25-2006 12:14 AM
Upload Client File to Server using Java Servlet hust6 Java 2 07-25-2006 12:25 PM
Upload a file without file Upload control - ASP.Net =?Utf-8?B?U2FyYXY=?= ASP .Net 3 08-03-2005 01:09 AM
File upload servlet using MultipartRequest - file not created on the server Paul Smith Java 1 11-17-2003 10:24 AM
Upload Excel with Macros using HTML File Upload Prakash ASP General 3 11-12-2003 04:26 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57