|
how to restrict a website's particular page on the system's NIC id?
i want to build a page that should be opened on a specific system/PC and it will be accessed via internet as a part of a web-portalMir Asrhaf Ali Usmani
|
|
|
|
|
i have to download videos from specific location
it is downloaded but when i play the video which is
downloaded from website is not playing please help me here is my code and my site is www.bigbonenews.net/downloadvideo.asp?id=33
<!--#include file="common.asp"-->
<%
OpenDataBase conn
id=request("id")
'if id="" then response.Write("no news is present")
'sql1="select * from newsvideo"
'set rs=server.createobject("adodb.recordset")
'rs.open sql1,conn,1,1
'while rs.eof<>true
sql="select * from newsvideo where newsid=" & id
set obj=server.createobject("adodb.recordset")
obj.open sql,conn,1,1
if obj.eof<>true then
'response.write(obj("news_titile"))
body="http://www.bigbonenews.net/videos/" & obj("videoname") & vbcrlf
'obj.close
'obj.movenext
end if
Server.ScriptTimeout=600
'OpenDataBase conn
'body="/videos/" & vbcrlf
'response.buffer=true
Dim stream
Dim contents
Dim filename
filename=obj("videoname")
body="http://www.bigbonenews.net/videos/" & filename
response.buffer=true
strFileType = lcase(Right(filename, 4))
'another file code starts here
Select Case strFileType
Case ".asf"
ContentType = "video/x-ms-asf"
Case ".avi"
ContentType = "video/avi"
Case ".doc"
ContentType = "application/msword"
Case ".zip"
ContentType = "application/zip"
Case ".xls"
ContentType = "application/vnd.ms-excel"
Case ".gif"
ContentType = "image/gif"
Case ".jpg", "jpeg"
ContentType = "image/jpeg"
Case ".wav"
ContentType = "audio/wav"
Case ".mp3"
ContentType = "audio/mpeg3"
Case ".mpg", "mpeg"
ContentType = "video/mpeg"
Case ".rtf"
ContentType = "application/rtf"
Case ".htm", "html"
ContentType = "text/html"
Case ".asp"
ContentType = "text/asp"
Case Else
'Handle All Other Files
ContentType = "application/octet-stream"
End Select
response.Write(strFileType)
'rs.close
'conn.close
Response.AddHeader "Content-disposition","attachment;filename=" & filename
response.contenttype=ContentType
response.write body
response.end
%>
<form action="downloadvideo.asp" method="post">
<input type="hidden" name="id" value="<%=id%>">
</form>
<!--starts Main Body -->
<!--startclickprintinclude-->
<!--starts Top News Story -->
|
|
|
|
|
First I would suggest getting rid of all commented out code before posting. It makes it much easier for other people to read and understand what is going on in your code.
You are setting the content type but then you are doing a response.write of a piece of text that happens to be a URL. So all of the "downloaded" files will just be text files with a URL in them. Since it seems the videos are stored on your web server and not in the database, there is no need to set the content type. Just redirect to the URL of the video itself. The web server will set the content type automatically.
OpenDataBase conn
id=request("id")
sql="select * from newsvideo where newsid=" & id
set obj=server.createobject("adodb.recordset")
obj.open sql,conn,1,1
if obj.eof<>true then
response.redirect "http://www.bigbonenews.net/videos/" & obj("videoname")
else
response.write "Video not found"
end if
obj.close
|
|
|
|
|
Please help. Here is the record layout of my Access Database.
ID VENDNO VENDOR BEL COL HAR JEF MOR SUPNO SUPPLY
On my webpage I have an image of a five county area in Ohio with hotspots. (BEL, COL, HAR, JEF, MOR are those counties)When a visitor clicks on a county (the link looks like ?county=COL) then I want the code to show every vendor that does not have an "X" in the corresponding county. Here is the code I have so far:
<%
Set connectionToDatabase=Server.CreateObject("ADODB.Connection")
connectionToDatabase.ConnectionTimeout=60
connectionToDatabase.Open "DSN=ICDC_Brands"
Set recordSet=Server.CreateObject("ADODB.Recordset")
recordSet.Open "SELECT * FROM vendor", connectionToDatabase
if Request.QueryString("county") = "" then
Response.Write("")
elseif Request.QueryString("county") <> "" then
Do While NOT recordSet.EOF
I think this is problem line --> If recordSet("Request.QueryString") <> "X" Then
Response.Write(recordSet("VENDOR") & "<br>")
end if
recordSet.MoveNext
Loop
end if
connectionToDatabase.Close
Set connectionToDatabase=Nothing
%>
When I visit the page and click on a county, the web browser says:
ADODB.Recordset error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name or ordinal.
/test/brands.asp, line 110
Any thoughts would be appreciated. Thank youmodified on Wednesday, February 10, 2010 3:47 PM
|
|
|
|
|
change that line
If recordSet(Request.QueryString("county")) <> "X" Then thatraja
|
|
|
|
|
|
I think the problem is with this line:
Response.Write(recordSet("VENDOR") & "<br>")
As I can see VENDOR is the table name from database. You can try using some column name from VENDOR table."Legacy code" often differs from its suggested alternative by actually working and scaling.
—Bjarne Stroustrup
|
|
|
|
|
sduffield wrote
Please help. Here is the record layout of my Access Database.
ID VENDNO VENDOR BEL COL HAR JEF MOR SUPNO SUPPLY
actually he already mentioned the table structure so you can see the "VENDOR" column.
thatraja
|
|
|
|
|
|
No problem, Here before i did also somewhere like you.
thatrajamodified on Thursday, February 11, 2010 5:10 AM
|
|
|
|
|
Thank you for your thoughts
|
|
|
|
|
Hello,
I would like to build a simple personal website for publishing personal projects and some articles. Which engine would you recommend to use? Preferably something that is easy to use for someone who is not really good at web development.
Thanks.
|
|
|
|
|
I am using VS 2008 with MVC on Win7.
A web app control (CrystalReportViewer ) is unable to find a .htm file:
"/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer4/html/crystalexportdialog.htm"
On Windows Server 2k3, this exists under c:\inetpub.
There is this file structure on my Win7 system:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\ASP.NETClientFiles\CrystalReportWebFormViewer4\html\crystalexport.htm
The VS development server doesn't seem to be finding the path.
Is there something I can change in VS or the project?
ps. The server does find crystalprintdialog.htm in the same path. I don't know what path the control is passing for that to work."The activity of 'debugging', or removing bugs from a program, ends when people get tired of doing it, not when the bugs are removed." - "Datamation", January 15, 1984
|
|
|
|
|
I'm working in a CHTMLView and trying to pass information to a print template.
I have found one method that works. Since I dynamically build the document I can place a non-display tag with an ID:
<div id="IEFooter">
My footer
</div>
That I can access in the print template with:
dialogArguments.__IE_BrowseDocument.getElementById(id)
that works, but I'd like more flexibility. When the document is loaded but before print/print preview I'd like to set the value. I can get the value but put_innerText always sets it to a NULL string:
IDispatch *pHtml = GetHtmlDocument();
IHTMLDocument3 *pHtmlDoc = NULL;
IHTMLElement *pDiv = NULL;
pHtml->QueryInterface(IID_IHTMLDocument3, (void **)&pHtmlDoc);
pHtmlDoc->getElementById(L"IEFooter", &pDiv);
if ( pDiv )
{
BSTR text;
pDiv->get_innerText(&text);
text = L"this is my dynamic footer text";
HRESULT hr = pDiv->put_innerText(text);
hr = pDiv->get_innerText(&text);
}
I've moved IEFooter around in the document but that doesn't seem to matter.
I tried a separate approach, using CHTMLView::PutProperty. That appears to work in that I can retrieve the string with GetProperty in my app but have no idea how to get to that property in JScript.
Any suggestions will be appreciated.
|
|
|
|
|
using the thousand monkeys at the keyboard approach I happened upon a solution. put_innerHTML happens to work, in this case, for me...
Many thanks to MS for their detailed documentation and extensive supply of sample code.
|
|
|
|
|
Hi,
I have developed small web application using ASP.Net and MySQL. I need to access this application using IP address from my friend system(In Office). Is it possible? I am having Windows XP.
Note:
From Windows 2003 Server I am hosting that web application and changed localhost to IP Address and its possible to access from others system. (ie) Server IP address (http://192.145.1.20/VDR/Login.aspx)
How to acheive by Windows XP with IIS?
Thanks,
Subbu
|
|
|
|
|
I have been trying to embed a flash coverflow.
The coverflow requires flash player version 10, I have this installed and when i tested using HTML the coverflow displayed with no problems. I then tried adding the same code to an aspx page and the file is not being displayed.
Can anyone shed some light on my problem? Ant help is greatly appreciated.ASP all the way
|
|
|
|
|
hi,
We have one web application. When we run this application first we will get login page there we given our credentials(Windows Authentication). It is working fine.
Now we deployed this application, now it is not redirecting next page even if we given proper username and password.
Can anybody help me how to resolve this one.
|
|
|
|
|
Hi guys, i am building a program to export some data to excel, i've used this code:
Set ExcelApp = CreateObject("Excel.Application")
ExcelApp.Workbooks.Add
Set ExcelBook = ExcelApp.ActiveWorkbook.Sheets(1)
ExcelBook.Cells(1,1).Value = "name"
ExcelBook.Cells(1,2).Value = "code"
ExcelBook.SaveAs "E:\inetpub\wwwroot\dominios\file.xls"
ExcelApp.Quit()
Set ExcelApp = Nothing
Set ExcelBook = Nothing
but, im having problems with the "code" cell, i need to transform this cell into a string or text type, and i dont know how to do this, i already tried
ExcelBook.Cells(1,2).Type = String, and didnt work... can some one help me please???? thank u very much... and sorry for the bad english.
|
|
|
|
|
|
it doesnt work for me, i need it in ASP, not in .NET... and it cant be on <table>, cuz the outher program that will read the file, cant read this <table>(html) excel.... thank u anyway
modified on Wednesday, February 10, 2010 10:49 AM
-- Modified Wednesday, February 10, 2010 10:50 AM
|
|
|
|
|
Hi,
IIS 6.0 was wokring on my Laptop but right now it is not working at the moment.
Ihave tried so many times to start IIS (Default Web Site) but I am not able to do so
I think it is happning due Apache Server which I have installed recently.
Could you please help me out- How can I start IIS again?
Thanks in advance.... Thanks,
Ankur Bakliwal
|
|
|
|
|
Switch off Apache and try (from a command line) iisreset /reset.
If that doesn't do it try unsinstalling Apache and reinstalling IIS.
|
|
|
|
|
how to refresh (not redirect) a HTTPS page with simple html code?
what I want to do is to refresh a secured page every few minutes so that it won't time out. the pc is blocking activeX or even javascript. so need to use simple html code. meta http-equiv="refresh" work with HTTP pages but not HTTPS pages.
any help are greatly apprecaited.
|
|
|
|
|
Mate, i think, using HTML you can't perform that, but javascript will help.
below coding is refreshes the page every 5 seconds. but i can't able to check in HTTPS page because i don't have any of that.
<body onload="window.setTimeout('window.location.reload()',5000);"> Please let me know if this works
thatraja
|
|
|
|