473,325 Members | 2,712 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,325 software developers and data experts.

Upload file question

I am using the upload file object : <input id="MyFile" style="width:300px"
type="File" runat="Server">.

When I upload a file, I am saving the name of the upload file and want to be
able put the name into the field directly when I select the record with the
file name on it.

I tried:

MyFile.PostedFile.FileName = UploadFileName.Text

But got the error:

Property 'FileName' is 'ReadOnly'

Is there a way of filling that text box, without having to browse the disk
for it?

Thanks,

Tom
Nov 19 '05 #1
4 1381
I'm afraid not. This is a security measure, to prevent unscrupulous
developers from writing web pages that lift files from the user's file
system, and it cannot be avoided.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"tshad" <ts**********@ftsolutions.com> wrote in message
news:es*************@TK2MSFTNGP12.phx.gbl...
I am using the upload file object : <input id="MyFile" style="width:300px"
type="File" runat="Server">.

When I upload a file, I am saving the name of the upload file and want to
be able put the name into the field directly when I select the record with
the file name on it.

I tried:

MyFile.PostedFile.FileName = UploadFileName.Text

But got the error:

Property 'FileName' is 'ReadOnly'

Is there a way of filling that text box, without having to browse the disk
for it?

Thanks,

Tom

Nov 19 '05 #2
Use it this way:

FileInfo info = new FileInfo(filename.PostedFile.FileName);

So you'll have all the info about the file.

Hope this helps
Al

"tshad" wrote:
I am using the upload file object : <input id="MyFile" style="width:300px"
type="File" runat="Server">.

When I upload a file, I am saving the name of the upload file and want to be
able put the name into the field directly when I select the record with the
file name on it.

I tried:

MyFile.PostedFile.FileName = UploadFileName.Text

But got the error:

Property 'FileName' is 'ReadOnly'

Is there a way of filling that text box, without having to browse the disk
for it?

Thanks,

Tom

Nov 19 '05 #3
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:O$**************@TK2MSFTNGP12.phx.gbl...
I'm afraid not. This is a security measure, to prevent unscrupulous
developers from writing web pages that lift files from the user's file
system, and it cannot be avoided.
Unscrupulous developers?

Come on - there aren't any of those out there, are there?

Thanks,

Tom
--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Ambiguity has a certain quality to it.

"tshad" <ts**********@ftsolutions.com> wrote in message
news:es*************@TK2MSFTNGP12.phx.gbl...
I am using the upload file object : <input id="MyFile" style="width:300px"
type="File" runat="Server">.

When I upload a file, I am saving the name of the upload file and want to
be able put the name into the field directly when I select the record
with the file name on it.

I tried:

MyFile.PostedFile.FileName = UploadFileName.Text

But got the error:

Property 'FileName' is 'ReadOnly'

Is there a way of filling that text box, without having to browse the
disk for it?

Thanks,

Tom


Nov 19 '05 #4

"tshad" <ts**********@ftsolutions.com> wrote in message
news:es*************@TK2MSFTNGP12.phx.gbl...
I am using the upload file object : <input id="MyFile" style="width:300px"
type="File" runat="Server">.

When I upload a file, I am saving the name of the upload file and want to
be able put the name into the field directly when I select the record with
the file name on it.

I tried:

MyFile.PostedFile.FileName = UploadFileName.Text

But got the error:

Property 'FileName' is 'ReadOnly'

Is there a way of filling that text box, without having to browse the disk
for it?

Thanks,

Tom


*grin* Hey now, there should always be a way around it...

MyFile.Attributes.Add( _
"onload", _
"javascript:document.getElementById('MyFile').valu e = " & _
UploadFileName.Text & _
";" _
)

Try that out, remember, top of my head so it may be a bit buggy :)

Mythran

Nov 19 '05 #5

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

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
4
by: Matt Jensen | last post by:
Howdy I've got a rather strange issue occuring. I used forms based .NET authentication, although I'm also setting some session variables when people login. However, I've found when people use...
1
by: joshbeall | last post by:
Hi All, If I drop a form onto my page that allows file uploads, I know well enough how to handle the file upload in the server side via PHP. However, I have a question: when my browser...
1
by: Marko Vuksanovic | last post by:
I used the following code for implementing a file upload progress indicator, using UpdateProgress Panel, though I have a problem that FileUpload.Has File always returns false. Any suggestions what...
7
by: pbd22 | last post by:
hi. i am having probs understanding how to grab a file being uploaded from a remote client. i am using hidden input fields for upload such as: <input id="my_file_element" type="file"...
6
by: =?ISO-8859-1?Q?J=F8rn?= Dahl-Stamnes | last post by:
I have a strange problem when uploading a PDF document to a web-server. When I try this to a web-server running Apache 2 on a FC 4, it fails. Firefox says that the document contain no data. If I...
2
by: will.smothers | last post by:
All, I have two Windows Server 2003 boxes running IIS 6.0 webservers that host our proxy pac file. These two servers are behind a network load- balancer and house our corporation's Proxy PAC file....
1
by: lPrentice | last post by:
Hello, After all this time, Linux file permissions still confuse me at times. I have a Python web-based application with an file (images) upload module. The application is running on two remote...
12
by: GuangXiN | last post by:
I want the file upload element disappear, instead of it, I place a text box and a button with my own css defination. but it doesn't work on IE7. What should I do now? <form action="upload.php"...
43
by: bonneylake | last post by:
Hey Everyone, Well this is my first time asking a question on here so please forgive me if i post my question in the wrong section. What i am trying to do is upload multiple files like gmail...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.