|
<input type="file"> That's the basics - how the file is actually selected depends on the browser and OS.
|
|
|
|
|
I'm afraid that's not the answer. As shown in the question, this is some code I found on somebody's website. It works in Netscape and in IE so I don't believe that, in general, it's browser specific.
Hey, I don't think this is hard; I just don't know the answer.
A man has to believe in something. I believe I'll go fishing.
|
|
|
|
|
Linking to a doc file in IE will, by default, open it in the browser - as will any file type that IE recognises the MIME type for.
Nutscrape works differently, in that it does not recognise the MIME type for .doc files as one it can display, so gives the user the option to download it.
To force the file download dialog, you can supply the file in a .zip archive, which both IE and NS will recognise as one which cannot be displayed in the browser. An alternative is to stream the file in the response, with a MIME type of "application/octet-stream" - which will force said download dialog.
ASP.NET has a useful method, Response.WriteFile[^] for just this sort of operation.
|
|
|
|
|
Sorry man, not sure what i was thinking about when i replied yesterday, but totally misread your question. As Jamie noted, the easiest way of getting what you want is to change the MIME type to something that the browser won't recognize as something it should launch a specific application to handle. Usually the easiest way to do this is to just configure your server to always serve specific documents or document types as application/octet-stream , but ASP.NET and PHP both have ways of accomplishing the same thing.
|
|
|
|
|
Thanks to both of you for the info. That's the way I'll do it; as a zip file.
"Nutscape" - that's a good one; I hate Nutscape.
A man has to believe in something. I believe I'll go fishing.
|
|
|
|
|
No need to zip the file. Just send headers that will tell the browser that they must download the file not open it.
Here is an example for exel files. You just have to find out the right mime-type for whatever your document is.
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
|
Hi
I have a Page and some UserControls and am trying out the tutorial here on mastering user control communication: http://www.codeproject.com/aspnet/Page_UserControl.asp but I ran into some problems with it.
I cant refer to my page classes to get the properties. I am missing a using directive or assempbly... thing. How can I make a UserControl, or a Page (SamplePage) visible in other pages? They are in the same project.
// Richard
|
|
|
|
|
Hello,
I put an image control on the page and set the ImageUrl property to "~App_Data/Emblem.gif" but when I browse the page,I see that image is not shown.
When I change the ImageUrl property to "C:\Downloads\Emblem.gif" it works...
Why???
Thanks...
|
|
|
|
|
Is the image inside the App_Data folder?
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
can anybody help me out..its very urgent
Tanmoy Panja
Software Developer
mob:-9831970348
Intrasoft Technologies Pvt. Ltd.
5,Lake Temple road.
Kolkata-29.
|
|
|
|
|
hi everybody ,
please if somebody can send me a link of a good website teachs ASP.Net i wanna learn it from the begening cuz i know nothing at it yet
i i need to get a good course or a training CD makes comprehension more easly
thank you
try to be good if you can't be the best
|
|
|
|
|
www.asp.net
www.siteproject.com
www.gotdotnet.com
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
How to adjust confirm dialog box to make it return the same result for both buttons: always return true - location.reload(1), no matter what button is pushed OK or Cancel. Currently if Cancel pushed, script exit.
<br />
....<br />
function init() {<br />
for (i=0;i<messages.length;i++) alert(messages[i])<br />
if (! createWSHShell() && confirm('Please click Yes to proceed')) {<br />
location.reload(1);<br />
return<br />
}<br />
if (WSHShell) goWrite()<br />
}<br />
window.onload = init;<br />
</script><br />
</head><br />
-- modified at 7:49 Friday 21st April, 2006
|
|
|
|
|
No, you can't. But you can simply ignore the return value of the method.
-- modified at 8:20 Friday 21st April, 2006
Or perhaps you want to use an alert intstead, that only has one button.
---
b { font-weight: normal; }
|
|
|
|
|
Yes, I have version with alert box already. I just wanted two buttons. What do you meant by ignoring the return value of the method?
-- modified at 9:21 Friday 21st April, 2006
|
|
|
|
|
Why do you want two buttons if it doesn't matter which one you press? That's only confusing.
centrex wrote: What do you meant by ignoring the return value of the method?
If the return value shouldn't matter, just call the method and don't use the return value.
---
b { font-weight: normal; }
|
|
|
|
|
|
How? Just call it, and don't use the return value. It's so basic, that if you have any problem with it, you have to explain what it is.
---
b { font-weight: normal; }
|
|
|
|
|
I removed 'return', but when we click 'cancel', all exit, no loop.
<br />
function init() {<br />
for (i=0;i<messages.length;i++) alert(messages[i])<br />
if (! createWSHShell() && confirm('You really need click yes')) {<br />
location.reload(1);<br />
}<br />
if (WSHShell) goWrite()<br />
}<br />
window.onload = init;<br />
</script><br />
</head><br />
|
|
|
|
|
No, not the return value from your function, the return value from the call to the confirm method.
---
b { font-weight: normal; }
|
|
|
|
|
Could you correct the code how this should be?
|
|
|
|
|
Hardly, as the code is incomplete to start with.
What is the problem? Just call the method where you want the dialog displayed:
window.confirm('yadayada');
---
b { font-weight: normal; }
|
|
|
|
|
hi,i have a tack,i have to connect more then one database on the selection base on asp,when i select january form droupdown menu,then the database of jun open,and when i select feb,then database file named"feb.mdb open, and also per page 50 records show,when we click nect the selected month next 50 records shows,plz tell me about this,thnx
honey
|
|
|
|
|
First of all, why do you use separate databases? Unless you have a very specific reason, you should put the tables in the same database, or even in the same table of the database if the data is of the same kind.
If you need to use separate databases, you simply specify the file name in the connection string.
---
b { font-weight: normal; }
|
|
|
|