|
|
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
|
|
|
|
|
Paul Riley wrote:
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.
Good point. I might have a go....
I feel like I'm diagonally parked in a parallel universe
Jeremy Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
|
uniqueidentifier, adoguid, DataGrid
1. MY TABLE SCHEMA:
I have this table with the following schema:
column SQL server data type ado data type
MsgID uniqueidentifier adoguid
MsgTitle char(250) adchar
MsgBody char(5000) adchar
2. WHAT I DID:
I load the data into a DataSet, then load the DataSet into a DataView (i need it for RowFilter), then bind the DataView to DataGrid. Code snippet as follows:
oConn = new SqlConnection(sConnect);
daForum = new SqlDataAdapter(sCommand, oConn);
daForum.Fill(this.dsForum, "Forum"); //dsForum is the DataSet
this.dvForum.Table = this.dsForum.Tables["Forum"];
//DataView: Apply row filter - we want to display root message only: ie. ParentMsgID='Null'
dvForum.RowFilter="IsNull(ParentMsgID,'Null')='Null'";
//DataGrid:
this.dgForum.DataSource = dvForum;
this.dgForum.DataBind();
oConn.Close();
3. THE PROBLEM:
3a. MsgID column disappeared? Where did this happen? When I load it to DataView? Or when DataGrid binds to DataView?
3b. The intention is, when user click a row on the datagrid, I would retrieve MsgID with "ItemCommand" event handling mechanism:
protected void Command(Object Sender, DataGridCommandEventArgs e)
{
....
//Reference (data type): http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=454
Guid gdMsgID;
gdMsgID = e.Item.Cell[0].Text; //I wish to retrieve MsgID as follows.
}
code snippet will be very helpful... thanks!uniqueidentifier, adoguid, DataGrid
1. MY TABLE SCHEMA:
I have this table with the following schema:
column SQL server data type ado data type
MsgID uniqueidentifier adoguid
MsgTitle char(250) adchar
MsgBody char(5000) adchar
2. WHAT I DID:
I load the data into a DataSet, then load the DataSet into a DataView (i need it for RowFilter), then bind the DataView to DataGrid. Code snippet as follows:
oConn = new SqlConnection(sConnect);
daForum = new SqlDataAdapter(sCommand, oConn);
daForum.Fill(this.dsForum, "Forum"); //dsForum is the DataSet
this.dvForum.Table = this.dsForum.Tables["Forum"];
//DataView: Apply row filter - we want to display root message only: ie. ParentMsgID='Null'
dvForum.RowFilter="IsNull(ParentMsgID,'Null')='Null'";
//DataGrid:
this.dgForum.DataSource = dvForum;
this.dgForum.DataBind();
oConn.Close();
3. THE PROBLEM:
3a. MsgID column disappeared? Where did this happen? When I load it to DataView? Or when DataGrid binds to DataView?
3b. The intention is, when user click a row on the datagrid, I would retrieve MsgID with "ItemCommand" event handling mechanism:
protected void Command(Object Sender, DataGridCommandEventArgs e)
{
....
//Reference (data type): http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=454
Guid gdMsgID;
gdMsgID = e.Item.Cell[0].Text; //I wish to retrieve MsgID as follows.
}
code snippet will be very helpful... thanks!
norm
|
|
|
|
|
In particular, I want to do something like this:
protected void Command(Object sender, DataGridCommandEventArgs e)
{
Guid gdMsgID;
DataRow dr;
gdMsgID = (Guid) e.Item.Cells[0].Text;
dr = this.dsForum.Tables["Forum"].Rows.Find(gdMsgID);
//Alternative 1: string strItem = dgForum.SelectedItem.Cells[0].Text;
}
NOTE: BOTH Alternative 1 DOES NOT work. Error is something like "Cannot convert System.Guid to String..." ... something like that. But my problem is, the data grid does NOT even display the GUID column in the first place. What I really need is that GUID column be hidden in DataGrid, but the underlying DataSet should have the GUID column (MsgID). And I should be able to retrieve this column via OnCommand event handling mechanism. Any idea?
Thanks.
norm
|
|
|
|
|
I've got the Guid displayed on DataGrid, but still need to retrieve it and call stored procedure. I tried to force the column by manually entering BoundColumn - with "Visible=True":
<asp:boundcolumn visible="False" datafield="MsgID" headertext="MsgID">
<itemstyle horizontalalign="Center" width="0px">
The column is sitting right in front of my eyes. I worked gracefully.
I still need the column in Guid, so later on, in response to OnCommand, I can invoke a system stored procedure (SQL Server)
GetMsg(@MsgID, @MsgTitle, @MsgBody)
@MsgID is INPUT
@MsgTitle and @MsgBody are OUTPUT.
Code will look like:
OnCommand(...)
{
Guid gdMsgID;
String strMsgTitle;
String strMsgBody;
gdMsg = e.Item.Cells[0].Text; //PROBLEM 1!!
Set oCmd = Server.CreateObject("ADODB.Command");
With oCmd //Yeah, it's VBNET syntax. Havent figured out the C# equivalent yet - if there's one. I checked sever places, it seems there's NO equivalent in C#.
.ActiveConnection = oConn;
.CommandText = "sproc_GetMsg";
.CommandType = adCmdStoredProc;
//PROBLEM 2: 128 bits? Should I put 16 BYTEs for size?
.Parameters.Append( .CreateParameter("@MsgID", adGUID, adParamInput, 16, gdMsgID) );
//Output:
.Parameters.Append( .CreateParameter("@MsgTitle", adChar, adParamOutput, 100, strMsgTitle ) );
.Parameters.Append( .CreateParameter("@MsgBody", adChar, adParamInput, 1000, strMsgBody ) );
End With //Yeah, it's VBNET syntax...
}
Thanks.
norm
|
|
|
|
|
Found a way to get around this. I will just pass strMsg (in String format) to the stored procedure and have the stored procedure to do the conversion from String to UniqueIdentifier.
Still want to know if there's a way to get GUID from OnCommand/DataGrid mechanism.
norm
|
|
|
|
|