ho reperito questo codice per il download di file con password ma non funziona.
Non sò dove il percorso del file e nemmeno dove mettere il nome del file stesso.
Grazie
ho reperito questo codice per il download di file con password ma non funziona.
Non sò dove il percorso del file e nemmeno dove mettere il nome del file stesso.
Grazie
Pattaya
Questo quale?Originariamente inviato da pattaya
ho reperito questo codice per il download di file con password ma non funziona.
Non sò dove il percorso del file e nemmeno dove mettere il nome del file stesso.
Grazie![]()
Il guaio per i poveri computers e' che sono gli uomini a comandarli.
Attenzione ai titoli delle discussioni: (ri)leggete il regolamento
Consultate la discussione in rilievo: script / discussioni utili
Usate la funzione di Ricerca del Forum
Scusatemi...
questo:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%>
<% Option Explicit
' On Error Resume Next %>
<html>
<head>
<title>Download</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<%
If IsEmpty(Request.QueryString("FileName")) Then
Else
Response.Write("<META HTTP-EQUIV='refresh' CONTENT='5'; URL='Downloads/" & Request.QueryString("FileName") & " '>")
End If
%>
<SCRIPT LANGUAGE=vbscript>
'================================================= ==================
'= Handel the button click, we set a value of the hiden text field
'= so the ASP code can know what to do.
'================================================= ==================
Sub Download_onclick()
document.MainForm.Actions.value ="Download"
End Sub
</SCRIPT>
</head>
<body>
<%
If IsEmpty(Request.QueryString("FileName")) Then
Select Case Request.Form("Actions")
Case "Download"
Dim ADOConnection, ADORecordset
Set ADOConnection = Server.CreateObject("ADODB.Connection")
Set ADORecordset = Server.CreateObject("ADODB.Recordset")
ADOConnection.Provider = "Microsoft.Jet.OLEDB.4.0"
ADOConnection.Open ("Data Source=" & Server.MapPath("mdb-database/LoginInformation.mdb"))
ADORecordset.ActiveConnection = ADOConnection
ADORecordset.CursorType = 3: ADORecordset.CursorLocation = 3: ADORecordset.LockType = 3
ADORecordset.Open("Select * From [UsersInfo] Where UserName ='" & Request.Form("UserName") & "' And Password='" & Request.Form("Password") & "'")
If ADORecordset.RecordCount > 0 Then
Response.Redirect("?FileName=File.zip")
Else
Call CreatTheForm("<font color='#FF0000'>Uncorrect Uername or password,
Try again.</font>")
End If
ADORecordset.Close
Case Else
Call CreatTheForm("<font color='#333333'>Enter the Username and Password then click download</font>
")
End Select
Else
Response.Write("<table width='480' border='0' cellpadding='2' cellspacing='2' bgcolor='#FFFFFF'>")
Response.Write(" <tr align='eft' valign='middle'>")
Response.Write(" <td width='10'>[img]time.gif[/img]</td>")
Response.Write(" <td width='384'><font size='2' color='#333333' face='Tahoma, Arial, times New Roman'>")
Response.Write("Your download will start in 5 seconds.
")
Response.Write("If it doesn't Start automatically click ")
Response.Write("here")
Response.Write("</font></td>")
Response.Write(" </tr>")
Response.Write("</table>")
End If
'_________________________________________________ __________________________________________________ _______________
Sub CreatTheForm (TheHeaderMsg)
Response.Write("<form action='' method='post' name='MainForm'>")
Response.Write("<table width='480' border='0' cellpadding='2' cellspacing='2' bgcolor='#F4F4F4'>")
Response.Write(" <tr align='eft' valign='middle'>")
Response.Write(" <td width='10'>[img]download.gif[/img]</td>")
Response.Write(" <td width='384'><font size='2' color='#333333' face='Tahoma, Arial, times New Roman'>To start downloading the file enter a correct Username and Password.</font></td>")
Response.Write(" </tr>")
Response.Write("</table>")
Response.Write("<table width='480' border='0' cellspacing='2' cellpadding='2' bgcolor='#F4F4F4'>")
Response.Write(" <tr>")
Response.Write(" <td colspan='2'><font size='2' face='Tahoma, Arial, times New Roman'>" & TheHeaderMsg & "</font></td>")
Response.Write(" </tr>")
Response.Write(" <tr>")
Response.Write(" <td width='100' align='left'><font color='#333333' size='2' face='Tahoma, Arial, times New Roman'>Username</font></td>")
Response.Write(" <td width='380' align='left'><input name='UserName' type='text' id='UserName'></td>")
Response.Write(" </tr>")
Response.Write(" <tr>")
Response.Write(" <td align='left'><font color='#333333' size='2' face='Tahoma, Arial, times New Roman'>Password</font></td>")
Response.Write(" <td align='left'><input name='Password' type='TEXT' id='Password'></td>")
Response.Write(" </tr>")
Response.Write(" <tr>")
Response.Write(" <td colspan='2'><input name ='Download' type='submit'Value='Download' title=' Download ' onClick='Download_onclick()'></td>")
Response.Write(" </tr>")
Response.Write("</table>")
Response.Write("</form>")
End Sub
%>
</body>
</html>
Pattaya
fantastico. TU reperisci il codice, e NOI dobbiamo studiarlo per dirti come funziona? Dimmi che ho capito maleOriginariamente inviato da pattaya
ho reperito questo codice per il download di file con password ma non funziona.
Non sò dove il percorso del file e nemmeno dove mettere il nome del file stesso.
Grazie![]()
Non è così!
Io, come già detto, non conosco asp e smanetto fino a quando non trovo altra via che chiedere aiuto.
Ho provato a cambiare i percorsi ed il nome del file ma non ci arrivo...
Pattaya
beh, almeno rileggi quello che scrivi
Originariamente inviato da pattaya
Non sò dove il percorso del file e nemmeno dove mettere il nome del file stesso.
ti conviene partire dalle basi e imparare a programmare
se vai avanti così prima o poi nessuno ti risponderà più, ad ogni modo trova la parte di programma per la quale cerchi aiuto e fai la domanda, sicuramente ne io ne altri si metteranno a leggere il programma, sai anche noi lavoriamo
@pattaya sei un mitoma insisti optime in fondo è un tenerone (cuore di panna).
![]()
![]()
Cavicchi Andrea
Problemi con javascript, jquery, ajax clicca qui
tempi duri per i troppo buoni![]()
Vi ringrazio comunque ad entranbi.
Sapete... ai quesiti che vi ho fatto sono riuscito a farli funzionare tutti a meraviglia.
Non saprei come fare senza di voi....![]()
Grazie ancora!
Pattaya