|
I design website in Dreamweaver MX and want to make a button "Download" so that users can download the file when they need. Please help me what to do.
I have never done it before so thinhking is very difficult. Could you give me the source code of it? (Javascript is OK) .
Any advice or idea appreciated.
Thank you very much in advance.
Thuydinh,
|
|
|
|
|
Thuy Dinh wrote:
I design website in Dreamweaver MX and want to make a button "Download" so that users can download the file when they need. Please help me what to do.
This is another misconception in web dev. I also had it when I first started.
To make a download link, you just use a normal A link. It is then up to the client as to how it is handled. If the link points to an HTML file then the client downloads it and opens it as a "normal" web page. If the link points to a file that the browser does not know how to handle, then it asks you to Save As or Save To or whatever. But it does not open it. That is the only difference when downloading say an HTML file or a Zip.
You can check this idea out by finding a machine that does not have Adobe Acrobat Reader on it, or does not have Microsoft Word. Click a link to one of those docs, you will see it asks to save the file and does not open it in the browser. Because the client does not know how to handle that file.
So you can make a download link like this:
<a href="files/downloadme.zip">Download</a>
Paul Watson Bluegrass Cape Town, South Africa
Roger Wright wrote:
Using a feather is kinky; using the whole chicken is perverted!
|
|
|
|
|
Thank you very much for your kind help me. I'll find what I want now.
Thuydinh,
|
|
|
|
|
|
|
|
Hi Guys,
Want to allow the public to upload jpg files to my webserver.
Does anyone have an ASP file upload component which calls a virus scanner.dll and scan the files as part of the upload process to the webserver? Or scans the files prior to completing the file-upload process? In that way you can send a message back to the web-user that their file contained a virus.
If I use just a normal virus scanner sitting on the server scanning memory, then end users don't get any feedback about the uploaded file. Plus you are left with a virus on your hard drive and hoping that the virus scanner will pick it up on the next scan.
Plus if you are wanting to do something with that file from another automated process and the virus scanner hasn't already killed or cleaned it, then you're in trouble.
Any suggestions??
|
|
|
|
|
Hi Andrew,
You may try this workaround. Normally all antivirus scanners have shell extensions, whereby you can scan from other application and have your application respond to the user depending on particular return value from the AntiVirus software. This way only WinZip works scanning the archives after you configure an antivirus scanner in its configuration.
Here are the steps:
- Use an object to execute the ShellExtension application of the antivirus software passing the file to scan as the argument. You can use http://www.serverobjects.com/ ASPExec too. This is free. For example on ShellExtensions for Antivirus, you may need to check up with the Antivirus Software Help files. For McAfee Viruscan, I think it is C:\Program Files\Common Files\Network Associates\On Demand Scanner\Scan32\scan32.exe. For AVG Antivirus from Grisoft, it is AVGSE.EXE from C:\Program Files\Grisoft\AVG\AVGSE.EXE
- After the file has been scanned, you may check out the return value, which should help you out to find whether the file has been infected or not and then suitably inform the user regarding the same.
Does this solve your doubt?
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
Thanks for this, will have a look at.
Andrew
|
|
|
|
|
Hi Guys,
Want to allow the public to upload jpg files to my webserver.
Does anyone have an ASP file upload component which calls a virus scanner.dll and scan the files as part of the upload process to the webserver? Or scans the files prior to completing the file-upload process? In that way you can send a message back to the web-user that their file contained a virus.
If I use just a normal virus scanner sitting on the server scanning memory, then end users don't get any feedback about the uploaded file. Plus you are left with a virus on your hard drive and hoping that the virus scanner will pick it up on the next scan.
Plus if you are wanting to do something with that file from another automated process and the virus scanner hasn't already killed or cleaned it, then you're in trouble.
Any suggestions??
Andrewpe
|
|
|
|
|
I have a class defined like this, in my css file:
.MyTD
{
height:20px;
}
And in the html file, I have:
...
<td class="MyTD">blah blah</td>
...
The problem is, in IE5, the height is "too small", and in IE6 it's OK. On the other hand, if I change the height in the css to 25px, it now looks OK in IE5, but now it is "too tall" in IE6.
What could be the cause of this?
I should mention here that both the PCs have the same dislay setting, same resolution, everything is the same, except the browser. So when I say it should be 25px, shouldn't it be 25px, no less, no more? Why does it look different on both the PCs?
Is there any way to include two different css files for IE5 and IE6? But then how can I be sure that the other browsers are dislaying it correctly? I don't have a lot of them installed, where I can test them. I thought the best thing would be to follow the standard, and this is what I am doing. My css file validates as CSS2 at the w3.org website. But then why this problem?
Any help with this would be much appreciated, and thanks a lot in advance.
Regards,
Rohit Sinha
Character is like a tree, and reputation like its shadow. The shadow is what we think of it; the tree is the real thing. - Abraham Lincoln
The whole world steps aside for the man who knows where he is going. - Anonymous
|
|
|
|
|
Well, IE5 didn't support standards, since they were still under development. This can answer to "why".
And yes, you can use different stylesheets for browsers. If you can do ASP, then just determine the browser and write out appropriate "link" tag. If not, well, try to do the same with javascript, e.g. using document.write()
Oh and don't try to catch ALL browsers. You can't IE5, IE6, Netscape and Opera are enough
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
Philip Patrick wrote:
If you can do ASP, then just determine the browser and write out appropriate "link" tag.
Yes, I think I'll have to do it that way. Thanks for the tip.
Regards,
Rohit Sinha
Character is like a tree, and reputation like its shadow. The shadow is what we think of it; the tree is the real thing. - Abraham Lincoln
The whole world steps aside for the man who knows where he is going. - Anonymous
|
|
|
|
|
Rohit Sinha wrote:
The problem is, in IE5, the height is "too small", and in IE6 it's OK. On the other hand, if I change the height in the css to 25px, it now looks OK in IE5, but now it is "too tall" in IE6.
Are you talking about the height of the font, or the height of the table cell (as you have embedded the text in a <td> tag) ?
I recommend to make all experimentations outside <td> tags, to avoid the weaknesses and changes of the browser table rendering algorithm throughout versions.
|
|
|
|
|
.S.Rod. wrote:
Are you talking about the height of the font, or the height of the table cell (as you have embedded the text in a tag) ?
The height of the table cell. I also defined other attributes of the td in the css file, but omitted them here, because I thought there were not relevant. Font weight, font family, borders, padding, etc. Is it possible that IE5 does not recognize, or chooses to ignore, some of these attributes, such as padding, which may be causing it?
Anyway, is there some way of making the browser include a different css file, depending on the browser type? I read somewhere about those "@import" tricks, but it's been a long time and I don't remember what they were, nor can I find the source again.
Of course, if everything fails, I'll detect the browser type in asp as Philip Patrick suggested above, and change it from there, but I want to make it a last resort.
Regards,
Rohit Sinha
Character is like a tree, and reputation like its shadow. The shadow is what we think of it; the tree is the real thing. - Abraham Lincoln
The whole world steps aside for the man who knows where he is going. - Anonymous
|
|
|
|
|
Rohit Sinha wrote:
Is it possible that IE5 does not recognize, or chooses to ignore, some of these attributes, such as padding, which may be causing it?
Yes, these unfortunate things are called bugs, or broken compatibility or even improvements (depending on your point of view). What's unsure is whether they were on purpose or not.
Rohit Sinha wrote:
Anyway, is there some way of making the browser include a different css file, depending on the browser type?
Yes. For instance, in your html header section add this :
<!--CSS_START-->
<SCRIPT SRC="dtuelink.js"></SCRIPT>
<!--CSS_END-->
dtuelink.js :
var ieVer = getIEVersion();
writeCSS(jsPath);
function getIEVersion() {
var verNum = 0
if (navigator.appName == "Microsoft Internet Explorer") {
var sVer = window.navigator.userAgent
var msie = sVer.indexOf ( "MSIE " )
if ( msie > 0 ) {
verNum = parseFloat( sVer.substring ( msie+5, sVer.indexOf ( ";", msie ) ) );
}
}
return verNum;
}
function writeCSS(spath) {
var dtueCSS = "";
var HxLinkPath = "";
var HxLink = "";
if ( ieVer == 4) {
....
}
document.writeln('<LINK REL="stylesheet" HREF="' + HxLinkPath + HxLink + '">');
document.writeln('<LINK REL="stylesheet" HREF="' + spath + dtueCSS + '">');
}
PS : word of wisdom, be sure to know that by adding pixel-fixed CSS styles, you are preventing your audience to resize the text in the browser.
|
|
|
|
|
|
Wow, thanks for the link. Turned out there is a slight discrepancy between IE5 and IE6 in the way they calculate the height and width of elements. IE6 does it the CSS way, while IE5 has got it slightly wrong. Not that it's going to help me get the height OK, except by following S/ Rod.'s advice above, but at least I know what else to watch out for.
Thanks a bunch.
Regards,
Rohit Sinha
Character is like a tree, and reputation like its shadow. The shadow is what we think of it; the tree is the real thing. - Abraham Lincoln
The whole world steps aside for the man who knows where he is going. - Anonymous
|
|
|
|
|
Hi,
I wanna make a web-based chatroom applicaiton in ASP or ASP+ or ASP.Net .
Please can anybody suggest me what is the preferable method to relay chat data (text) on web-based application. What is the effecient way to relay the textual data, and where should I kept that data on web-server in order to display during the chat in chat rooms.
regards
Dammy More
|
|
|
|
|
Well, there are many options available. Like holding all chat text/information in Application, or in XML files or plain text files on the server. You can find good examples here:
http://www.aspin.com/home/webapps/chat[^]
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
how can you dynamically add hidden form element in ASP.NET? In classical ASP, the following code will suffice:
function SubmitForm(objForm, value)
{
var objInput=document.createElement("Input"); //What should be the "type" for objInput? In C#, you cant just "var objInput". Tpye must be clearly specified.
objInput.type = "hidden";
objInput.name = "forum_table";
objInput.value = value;
objForm.appendChild(objInput);
//Submit the document.
objForm.submit();
return true;
}
So code snippet in C#/ASP.NET will be very helpful. THanks.
norm
|
|
|
|
|
How do you set the mouse over color of a DataGrid?
In ASP, for each row:
I dont see that in the property pane...
Thanks.
norm
|
|
|
|
|
use style sheets
********************
* $TeVe McLeNiThAn
********************
|
|
|
|
|
I have a list with loads of elements. I would like to provide an edit box that when typed into reduces the number of elements to matching ones only.
I wish to use JavaScript only, and I relaise I could use a large array, match the array, emply the list, and re-populate using the matches. however there are so many elements that I'd rather not create an array as this would slow the page download speed.
Perhaps is there any way I can make an element invisible? Can anyone think of a better way please? Thanks.
I feel like I'm diagonally parked in a parallel universe
Jeremy Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
|
Jeremy Davis wrote:
however there are so many elements that I'd rather not create an array as this would slow the page download speed
Would it? Surely if you have an array, you don't need the option tags because you can populate it onload? In theory you might reduce the size of your page.
There may be a better way, it just occurs to me that this is a strange presumption.
Paul
And you run and you run to catch up with the sun, but it's sinking Racing around to come up behind you again The sun is the same in a relative way, but you're older Shorter of breath, one day closer to death - Pink Floyd, Time
|
|
|
|
|