File Extension Validation before uploading the file....

Hi... I have an upload feature on my site... it works fine... but I want to validate the uploading file extension for .doc or .html before being uploaded to the server(client-side). I have the validation to check text fields are not blank.... The first validation is for checking the text field... the second "blob" is the file upload field.... This is my code in Vbscript.... can any one help please

Posted On: Friday 26th of October 2012 06:21:42 AM Total Views:  693
View Complete with Replies

Related Messages:

ASP files not executing on 2000 servers   (356 Views)
all, I have a .asp application lying out on a Windows 2000 server. The problem is it no longer is working. It seems that no .asp files will execute anylonger on this box. I even have a very basic .asp testfile that prints a line off text to the browser, but even these don't run. I got four errors in the event log for each failure. However, the browser displays this (with friendly error messages et to "off"): Server Application Error The server has encountered an error while loading an application during the processing of your request. Please refer to the event log for more detail information. Please contact the server administrator for assistance. The event log errors are : A COM+ device failed to start Did not register with DCOM within the timeout. Has anyone ever seen this sort of behavior. It seems every since we applied a few 2000 patches that this started happening. If anyone has any light to shed on this subject, please do. I would appreciate any help offered. -Benji
opening a webpage through an .exe file   (415 Views)
Hi everybody, I'm trying to open a webpage through an .exe file. But, dont know how to start. Can anyone help me.
Is there a way to check the files in a folder   (341 Views)
Is there a way to check the files in a specific folder, and then establish the links with the files on an asp page
How to prevent overwriting, when upload files using pure ASP   (537 Views)
I found this great article on about uploading stuff to a server from a internet client. The great thing is that it isn't an Object, but its PURE ASP and its FREE (whoo hoo). It works nice, and fast (although i only need it to allow my users to upload small Text files). But unfortunately if i upload a file that already exists it will be replaced (overwrite) with the new file and really, i don't want that to happened. (You never know) So my question is how do I prevent overwriting (I think that I need to make a new Sub function, but hell, that's just me) I could use an experts eye on this Code:
combine phpbb FetchAll mod with asp page: convert one php file to asp?   (283 Views)
I've got a site managed in Frontpage and a forum in phpBB/MySQL. I'd like to grab the most recent posts from the Announcements Forum and embed them in the site's homepage. I got the idea from . of their homepage posts are fed from their FrontPage Archive Forums. Right now, I'm using a phpBB mod called Fetch to do the job. It works great except for one thing: I have to do it via an inline frame because I can't include a PHP file in an ASP page, and I have to use ASP because the site is in Frontpage (project requirement; FP is essential to the non-forum part of the site). The inline frame doesn't look very elegant. I'd prefer for the posts to be embedded transparently in the page, as in the PocketPCThoughts site. The Fetch mod makes it easy for sites using php or .shtml for their homepage: they just use an include to call up a php file. The file is small -- including HTML, under 100 lines of code -- but it interacts with other parts of the Fetch mod. If I want to get rid of the inline frame and embed the forum posts directly in my site, I either need to switch away from Frontpage (not an option) or ask for your help. To embed posts directly in my site, would it be sufficient to convert the one small PHP file to ASP or would the entire Fetch mod have to be converted If it's just the one file, I'd be willing to pay for it, since I assume such a small project would warrant only a modest fee. If the entire mod has to be converted, well, that's too complicated and probably too expensive; I'd rather stick with the inline frame. One thing I should add: if converting this one file is all that's necessary, I plan to share the final code with the phpBB Fetch community under the same licence that governs the Fetch mod (with full credit to the hired programmer, naturally).
Help needed urgently.. Uploading CSV file to SQL Server   (373 Views)
.. Im new to ASP.. i need to know the codes to upload my csv file (*csv) generated from Excel to SQL Server. I aso need to have the codes for uploading my CSV file to my access database..Please provide me help. Thx a lot. cheers -hui-
Including files in ASP   (235 Views)
. I am trying to include several files in an ASP script. I have a common file that does the database handling, and that common file will include common functions and classes used throught the script. Although I've checked each of the files for errors, none seem to have any, but when I call a class included from another file, I get this: Error Type: Microsoft VBScript runtime (0x800A01FA) Class not defined: 'ASPTemplate' /test/test.asp, line 7 Any ideas
Code to convert file sizes   (362 Views)
Hi i have the following code that converts a file size into a readable format (10MB for example) to show to the user Code: if varSize >= 0 and varSize =< 99999 then varSize1 = varSize / 1000 strKB = 1 end if if varSize >= 100000 and varSize =< 999999 then varSize1 = varSize / 1000 & "KB" strKB = 1 end if if varSize >= 1000000 and varSize =< 99999999 then varSize1 = varSize / 1000000 strMB = 1 end if varTest = instr(varSize1, ".") varDisplay = left(varSize1,varTest-1) if strKB = 1 then varDisplay = varDisplay & " KB" end if if strMB = 1 then varDisplay = varDisplay & " MB" end if It does the job to a certain extent but, if you enter 10 as the file size it will produce a file size of 0. Does any one have any similar code or a way to improve what i have done
Newbie question (passing hyperlinks to asp file)   (619 Views)
Ok, I'm learning ASP. Here's the easiest way to describe the problem. Lets say I have a list of all of Jimi Hendrix's live shows. I can view the entire list at shows.asp. Now, what do I do if I just want to see shows for, lets say 1971 I want hyperlinks on my page for each year and when I click the year, it generates the list of shows from that year. I dont want to make an ASP file for every year. How do I do this Do I use a METHOD=GET and then do something like "shows.aspyear=1971" Basically, I'm trying to make a web-enabled database for band. So this is gonna get complicated. Like once I get a certain year, I may also want to view by states and so on.
Updating a file   (256 Views)
I have a file called homes.txt It contains the names of Homes currently on the market I accidently put in ND for homes, when it was supposed to be SD. The file is as follows. home1 TX listed home2 NY listed home3 AL listed home4 ND listed home5 WA listed home6 ND listed its a much longer list, but lets keep it simple. I want to update the file by changing all the homes in ND to SC. I tired to change it but for some reason it doesnt just change the regular expression I tell it to, it completely overwrites the file. when I run it, the file becomes blank. I can't figure out whats wrong.
question about include file   (262 Views)
I have a menu that I use as an include file. it's a horizontal menu that extends to show sub menus. the table the menu is in has silver background. my problem is that when i use the page as a include file the background color for the menu expands to cover the whole page. is there an issue with the include files that would cause the table color to migrate to all the tables if any one knows another way i can use this menu as an include file and keep the background color from migrating it would be greatly appreciated.
sending email with attached file from form   (355 Views)
hello. having trouble - i want to send an email from a web app with an attached file. the form is for users to enter email addresses to whom they want the attached file sent. I'm using ASP and CDONTS mail. Any help would be greatly appreciated. I've tried this code in my SendMail.asp file and it's not working: Your email has been sent. Thank you! Click here to send another postcard. Click here to return to Staffing and Recruiting Home Page. An error occurred processing your request. Please try again.
Javascript and VB script in same file   (229 Views)
I have a question. Is it possible to use javascript and vbscript on the same asp page or tl have a small piece of Vbscript on a javascript page. See i have built my entire web application in javascript. But my problem i have a login page and registration page but they are in vbscript and also the login page requires me to put a small piece of code on every password proctected page, which is why ill have to put a small chunk of VB script on my java script page. Can this be done
how to read a txtfile using do while loop   (351 Views)
your code is really messed up. to loop through file contents, i.e. lines have such code: Code: where objFile is the variable holding the file - it's much better than using variable name "f" in my opinion. good luck!
replacing a specific line in a text file quickly   (477 Views)
hey, i have a remove user and change password script written, but the only thing they are missing is the actual text file editing part. i have the file open because i have read it, but how can i delete a line that matches with 'OldLine' and put 'NewLine' where it was with a couple of lines of code
The database file or object is read only   (385 Views)
hello all Actually, I do not know why i can not add records to my access database table by using asp code, I get an error that tells me that the database file or object is read only file even though the file is not readable only from its proprties, I need some helpful information to solve this problem.
scan txt file to computer   (366 Views) in trouble now....!!! may u help me to scan txt file to computer. i need to know how to scan txt file from specific device to computer..
read and write datas into excel(.csv) file   (371 Views)
how can i read the datas in specific columns and rows from excel(.csv) file and then use that datas to calculate the min(example) and write the results into the same excel(.csv) file
Read & Parse Zip file using VB.NET   (283 Views)
i need to open a zip archive, identify a particular file and read it.
Inserting binary files.   (256 Views)
How can I insert a binary file into a SQL Server db using asp It must be possible cause SQL Server has a datatype called "varbinary". Thanx in advance Mojito