Strip Extension Function
Is there a string function to strip the file extension from a variable in ASP? If not any suggestions as to the best way to approach this?
View RepliesIs there a string function to strip the file extension from a variable in ASP? If not any suggestions as to the best way to approach this?
View RepliesI have been trying to figure out how to get a function to strip html tags from part of an html file. The way I need it achieved is as so: Code:
<% strOutput = stripHTML("<!--#include file=includes/MyInclude.asp-->") %>
The included file is html-rich, and if included in default.asp, it displays as such. However, as I am attempting to make my website accessible, I wish to be able to strip out the html tags on the included page dynamically.
I have used the following function (and have called it with the above statement) but am getting an error in my functions.asp file: Unexpected quantifier. This is on the line that states Code:
Anyone know of a good routine for stripping out HTML from a string?
View Replies View RelatedI'm using XMLHTTP to perform a simple screen scraping job.
When I try to have it "scrape" lines with embeded CSS declarations, it
renders them incorrectly, stripping the leading period. Consequently, my CSS
doesn't work.Here's how I'm calling it, but I don't think my implementation is the
problem.
Dim srvXmlHttp
Set srvXmlHttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
srvXmlHttp.open "GET", TearURL, false
srvXmlHttp.send()
If srvXmlHttp.status <> 200 Then
Response.Write "No Server Response"
Response.End
End If
Dim strRetval5
strRetval5 = srvXmlHttp.responseText
How can I strip the time part from the Now()?
View Replies View RelatedI have an ASP page which has a form for user to input some information and it gets stored in an Access database. The problem i am having is when a person enters a name with a special character, like Macy's, it gives a Jet database error.
What i am looking for is for a way to remove special characters from the form field in question, like apostrophes, when they tab to the next field. So if they input Macy's, when they go to the next field the previous field gets updated to Macys instead.
We have an unusual situation at the USC School of Medicine; we have to
covert every Web page to a template. The template is too wide to print and a
lot of our students print lectures, notes, etc. We thought we could keep to
the template and draw in the content from other files by using includes. BUT
these files are HTML files and therefore, have Body commands in them. If
this could work, we could put a printable link back to the other page and it
would print. Seems like a great solution except for the extra body commands.
We are using ASP for our scripting.
1. How much of a boondoggle will it be if the files have two body commands
in them. How many browsers would it break?
2. Is there a scripting way around this without creating some objects?
3. Is there something out there -- shareware or commercial -- that would fix
this problem.
4. Could something be done about this using pearl, for example?
We'd really like to do it this way because we can have the users create the
content, use the same file names all the time, thus overwriting the old
file, and the user would never get a chance to screw up the template.
Could someone help me work out out a way to either convert a smalldatetime
value from my database(access) to a normal date with out the trailing time.
Is it simple matter of using FormatDate or does one need to do string
maniupulation?
Current
9/13/2003 11:36:00 AM
What I want:
9/13/2003
I have a field with datetime values like below LISTING 1. me write code strip the time part so only values like "7/15/2005" will be left.
Note - We must be able to strip dates with double digit months and days, so
i can't just use the right function with a hard coded parameter. Code:
I'm looking for a easy way to pull all the zeros out of a variable. They can be leading, trailing, or in the middle. I just want them all gone.
View Replies View RelatedThe following pattern is used to strip HTML tags from a string. I need to remove the tags only if they contain a colon. Is it possible? How can I modify this regexp pattern to match only if a colon exists between the "<" and ">" ? Code:
<[^>]*>
I think a regular expression maybe the solution to the problem I have. My problem is I am pulling a list from a database which I want to list alphabetically. The problem is, the records are stored with a number before them:
eg."762348 - RecordA" --> So I want just the "RecordA" bit so I can list alphabetically.
What I want to do is strip off everything at the beginning up to the first Alphabetic character. Is a regular expression the way to go?
I just want the raw text of a string so I can display a preview of what is in the file.
View Replies View RelatedIf I have a search submit button, when I click submit button, it will submit
the form to search.asp for form processing.
This will be the URL: http://www.mycompany.com/search.asp?q=programming
But when I do search in google, search doesn't have any file extension. How
do they do that? I saw some site are like that too.
http://www.google.com/search?hl=en&...G=Google+Search
..asmx not getting parsed.whten I call a page with an .asmx extensionon my machine
all I get is the code, it does not get parsed.how can I fix this, can I manually add some ISAPI application to IIS to make it work.
How can I validate a file extension before it is being uploaded to the server?Let's say I want to check the last 3 or 4 chars of the file, if it is JPG. then upload it. If not, alert(Only JPG file allowed).I'm using this allow user to upload.
<form......>
<INPUT TYPE=FILE SIZE=102 NAME="attach1">
.....
</form>
I am trying to upload a file to the server but first I want to rename it to the users session id. Ok everything is working except when I rename it, it drops the file extension. What is the best way to get the previous file extension and add it to the new file name? Here is an example of what it is doing on my end.
filename: test.xls
rename: 123456678
what I need: 123456678.xls
I have a site that is HTML and I am considering moving it to ASP. However this site has a great deal of investement already on SEO and changing the extension on the files would take a hit to our rankings. I've heard that there is a way of saving the ASP files as HTML extension. Does anyone know how to do this?
View Replies View RelatedI got background in my left and right frames (tables) and on the background image there's a custom border on each side. I want the background to extend on a different resolution rather than repeat. Anyone know how I can pull this off?
View Replies View RelatedWhen I create an asp file and click on it on my local drive, photoshop opens it, because the asp extension is already defined to photoshop.
I know you can try to change that extension association in the windows folders options, but even though photoshop owns the extension, it does not appear in the list of extensions. Is there some way to get photoshop to let go of the extension?
I used to have a dreamweaver extension, which inserted the asp script for recordset paging, you know the one where at the bottom of the page there is a line of links allowing you to search through your recordsets without having to load them all in. Anyway I formatted my hard drive and thought i had saved it but i turns out i didn't and cannot find where i got it from.
If anyone has a dreamweaver mx extention for this can you please upload it as an attached file so i can download it.
i want to hide my ASP page extention in IE AND NE address bar how can i do this pls tell me about that.
View Replies View RelatedIf I want to know if a file exist. But I do not know it's extension, how shall I check the extension and if it exists? (I know the name which to check)
View Replies View RelatedIf you'll notice, there's a comment in this snippet that drops the extension. How can this be modified so that the extension IS shown?
Set myFileSys = Server.CreateObject("Scripting.FileSystemObject")
Set Folder = myFileSys.GetFolder(Server.MapPath("/meetings"))
for each file in Folder.Files
If Not file.name = "index.asp" Then
FileName = Left(file.name, (Len(file.name) - 4)) 'drop the extension
FileSize = cint(file.size / 1024) 'convert into kilobytes and drop the decimal
Response.Write("<li><a href='/meetings/" & file.name & "'>" & FileName & "</a> - " & FileSize & " K<br>" & chr(13))
End If
next
Set myFileSys = nothing
i want to hide my ASP page extention in IE AND NE address bar how can i do this pls tell me about that.
View Replies View RelatedI have a website in ASP. Is it possible to somehow hide the .asp extenstion, so that other don't know what backend language is being used?
View Replies View RelatedSometimes I have seen the URL doesn't have the file extension, like the following:
http://server/signup?id=1001
rather than
http://server/signup.asp?id=1001
anyone knows how to do that?
where can i find the ASP file upload dreamweaver extension for free? if not, would someone suggest a way to upload file into database using dreamweaver?
View Replies View RelatedBasically I want to parse an XML feed - the problem being the XML data itself has a .asp extension and a few query strings.
I can currently parse the same xml data if I save it with a .xml extension, just not with the .asp extension and query strings. Code:
I'm having problems with one of the websites on my MS2000 server. I can't publish a fp2000 web to it properly because it thinks fp server extensions are not installed.
Whenever I use the MMC snap in to check the server extensions for this web, it tells me that my admin tool is not compatible with installed server extensions. Not sure what to do with this.
How verify type or extension of file using ASPUPLOAD? I check documentation, but I didn't find anything else yet.
View Replies View RelatedI 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.. Code:
What's the difference between private and public functions in ASP? When should I use either?