 |
dan |
| Upload ASP |
29-01-2004 16:06 |
|
 |
dan |
..: Dottore :..

Registered: Oct 2002
Posts: 2446 (0.29 al dì)
Location: MI
Corso: Info
Anno: 3
Time Online: 11 Days, 7:56:39 [...]
Status: Offline
Edit | Report | IP: Logged |
Upload ASP
Ciao a tutti, ho urgente bisogno di sapere come fare l'upload di un file con ASP!
Se qualcuno sa come posso fare ... me lo dica!!!
Grazie, D.
|
|
29-01-2004 16:06 |
|
|
|  |
 |
[D]ani[J] |
| prova a buttare un'occhio [URL=http://www.dotnethe ... |
29-01-2004 17:49 |
|
 |
[D]ani[J] |
dsy moderator

Registered: Aug 2003
Posts: 1380 (0.17 al dì)
Location:
Corso: F47
Anno:
Time Online: 17 Days, 14:25:28 [...]
Status: Offline
Edit | Report | IP: Logged |
prova a buttare un'occhio QUA
__________________
Dani
e-mail: DaniJ@dsy.it
...ahhh ste donne!
Buoniiiiiisssimaaaa!
|
|
29-01-2004 17:49 |
|
|
|  |
 |
ripe |
| Quello è ASP.NET... credo che lui avesse bisogno ... |
29-01-2004 18:31 |
|
 |
ripe |
- up in the mountains -

Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline
Edit | Report | IP: Logged |
Quello è ASP.NET... credo che lui avesse bisogno ASP.
Allora, qui sotto ti incollo una classe comodissima... come si usa dovrebbe esserti abbastanza chiaro! 
%
Class FileUpload
Public Files
Private mcolFormElem
Private Sub Class_Initialize()
Set Files = Server.CreateObject("Scripting.Dictionary")
Set mcolFormElem = Server.CreateObject("Scripting.Dictionary")
End Sub
Private Sub Class_Terminate()
If IsObject(Files) Then
Files.RemoveAll()
Set Files = Nothing
End If
If IsObject(mcolFormElem) Then
mcolFormElem.RemoveAll()
Set mcolFormElem = Nothing
End If
End Sub
Public Property Get Form(sIndex)
Form = ""
If mcolFormElem.Exists(LCase(sIndex)) Then Form = mcolFormElem.Item(LCase(sIndex))
End Property
Public Default Sub Upload()
Dim biData, sInputName
Dim nPosBegin, nPosEnd, nPos, vDataBounds, nDataBoundPos
Dim nPosFile, nPosBound
biData = Request.BinaryRead(Request.TotalBytes)
nPosBegin = 1
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))
If (nPosEnd-nPosBegin) <= 0 Then Exit Sub
vDataBounds = MidB(biData, nPosBegin, nPosEnd-nPosBegin)
nDataBoundPos = InstrB(1, biData, vDataBounds)
Do Until nDataBoundPos = InstrB(biData, vDataBounds & CByteString("--"))
nPos = InstrB(nDataBoundPos, biData, CByteString("Content-Disposition"))
nPos = InstrB(nPos, biData, CByteString("name="))
nPosBegin = nPos + 6
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34)))
sInputName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
nPosFile = InstrB(nDataBoundPos, biData, CByteString("filename="))
nPosBound = InstrB(nPosEnd, biData, vDataBounds)
If nPosFile <> 0 And nPosFile < nPosBound Then
Dim oUploadFile, sFileName
Set oUploadFile = New FileCaricato
nPosBegin = nPosFile + 10
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34)))
sFileName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
oUploadFile.FileName = Right(sFileName, Len(sFileName)-InStrRev(sFileName, "\"))
nPos = InstrB(nPosEnd, biData, CByteString("Content-Type:"))
nPosBegin = nPos + 14
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))
oUploadFile.ContentType = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
nPosBegin = nPosEnd+4
nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2
oUploadFile.FileData = MidB(biData, nPosBegin, nPosEnd-nPosBegin)
If oUploadFile.FileSize > 0 Then Files.Add LCase(sInputName), oUploadFile
Else
nPos = InstrB(nPos, biData, CByteString(Chr(13)))
nPosBegin = nPos + 4
nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2
If Not mcolFormElem.Exists(LCase(sInputName)) Then mcolFormElem.Add LCase(sInputName), CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
End If
nDataBoundPos = InstrB(nDataBoundPos + LenB(vDataBounds), biData, vDataBounds)
Loop
End Sub
Private Function CByteString(sString)
Dim nIndex
For nIndex = 1 to Len(sString)
CByteString = CByteString & ChrB(AscB(Mid(sString,nIndex,1)))
Next
End Function
Private Function CWideString(bsString)
Dim nIndex
CWideString =""
For nIndex = 1 to LenB(bsString)
CWideString = CWideString & Chr(AscB(MidB(bsString,nIndex,1)))
Next
End Function
End Class
Class FileCaricato
Public ContentType
Public FileName
Public FileData
Public Property Get FileSize()
FileSize = LenB(FileData)
End Property
Public Sub SalvaSuDisco(sPath)
Dim oFS, oFile
Dim nIndex
If sPath = "" Or FileName = "" Then Exit Sub
If Mid(sPath, Len(sPath)) <> "\" Then sPath = sPath & "\"
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
If Not oFS.FolderExists(sPath) Then Exit Sub
Set oFile = oFS.CreateTextFile(sPath & FileName, True)
For nIndex = 1 to LenB(FileData)
oFile.Write Chr(AscB(MidB(FileData,nIndex,1)))
Next
oFile.Close
End Sub
End Class
%>
__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»
|
|
29-01-2004 18:31 |
|
|
|  |
 |
GaL3n |
| Sicuramente quella di RIPe funge senza problemi in ... |
30-01-2004 13:25 |
|
 |
GaL3n |
Ninja Bisbetico

Registered: Jan 2003
Posts: 446 (0.05 al dì)
Location: Altrove
Corso: Informatica
Anno: Terzo Conclamato
Time Online: 7 Days, 18:53:06: [...]
Status: Offline
Edit | Report | IP: Logged |
Sicuramente quella di RIPe funge senza problemi in ogni:
<%
Dim bytetotali
Dim binario
Dim I, S
bytetotali = request.totalbytes
if bytetotali < 1000000 then
binario = request.BinaryRead(request.TotalBytes)
For I = 1 To LenB(binario)
S = S & Chr(AscB(MidB(binario, I, 1)))
Next
SimpleBinaryToString = S
else
Dim cl1, cl2, cl3, pl1, pl2, pl3
Dim L
cl1 = 1
cl2 = 1
cl3 = 1
L = LenB(binario)
Do While cl1<=L
pl3 = pl3 & Chr(AscB(MidB(binario,cl1,1)))
cl1 = cl1 + 1
cl3 = cl3 + 1
If cl3>300 Then
pl2 = pl2 & pl3
pl3 = ""
cl3 = 1
cl2 = cl2 + 1
If cl2>200 Then
pl1 = pl1 & pl2
pl2 = ""
cl2 = 1
End If
End If
Loop
S = pl1 & pl2 & pl3
end if
Const ForReading = 1, ForWriting = 2
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("c:\temp\fileprova.txt", ForWriting, True)
f.Write S
f.close
response.write "Ho ricevuto : " & bytetotali & " byte"
%>
|
|
30-01-2004 13:25 |
|
|
|  |
 |
fabpicca |
| ...giusto per rimanere in tema...
... |
30-01-2004 13:37 |
|
 |
fabpicca |
jesus robot d'acciaio

Registered: May 2002
Posts: 2166 (0.25 al dì)
Location: Pieve Emanuele
Corso: Ticom
Anno: 1°
Time Online: 12 Days, 23:12:28 [...]
Status: Offline
Edit | Report | IP: Logged |
...giusto per rimanere in tema...
PHP RULEZ
__________________
my website?|ubuntu linux|get Firefox|grazie Polonia |bagdad sour
"Come va che non ha le corna e le zampe di Caprone?" gli opposi. "Oh, Giuvà", mi disse il prete "adesso non si usa più.Satana è furbo". (I.Silone, Fontamara)
"Al giorno d'oggi non bisogna essere intelligenti, perchè la gente si offende" (un ubriacone)
"close your eyes / pay the price / for your paradise" (DM) "whatever you want to change/you'd better start changing it in your mind" (Transatlantic)
|
|
30-01-2004 13:37 |
|
|
|  |
 |
dan |
| Sono d'accordo con te ma se su un server mi trovo ... |
30-01-2004 14:55 |
|
 |
dan |
..: Dottore :..

Registered: Oct 2002
Posts: 2446 (0.29 al dì)
Location: MI
Corso: Info
Anno: 3
Time Online: 11 Days, 7:56:39 [...]
Status: Offline
Edit | Report | IP: Logged |
Sono d'accordo con te ma se su un server mi trovo Access e ASP non posso che utilizzare quelli !
Anche se , appena posso, uso PHP!
|
|
30-01-2004 14:55 |
|
|
|  |
 |
ripe |
| [QUOTE][i]Originally posted by fabpicca [/i]
... |
30-01-2004 16:00 |
|
 |
ripe |
- up in the mountains -

Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline
Edit | Report | IP: Logged |
Originally posted by fabpicca
...giusto per rimanere in tema...
PHP RULEZ
Uhm... e su quali basi lo dici?? Secondo me non hai mai scritto una sola riga di ASP... 

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»
|
|
30-01-2004 16:00 |
|
|
|  |
 |
fabpicca |
| su quali basi lo dico?
... |
30-01-2004 17:49 |
|
 |
fabpicca |
jesus robot d'acciaio

Registered: May 2002
Posts: 2166 (0.25 al dì)
Location: Pieve Emanuele
Corso: Ticom
Anno: 1°
Time Online: 12 Days, 23:12:28 [...]
Status: Offline
Edit | Report | IP: Logged |
su quali basi lo dico?
test di performance ne trovi ovunque.
comunque...
potrebbe bastare se ti dicessi ad esempio che le variabili GET e POST sono passate come variabili globali e non necessitano di essere estratte da oggetti request?
o ad esempio che prima di attivare un server IIS ci penserei due volte visti gli enormi problemi di sicurezza, quando invece apache è il miglior webserver sistente per prestazioni e sicurezza?
o magari questa come la vedi?
PHP è gratuito.ASP si paga...a meno che non fai il furbo, certo...
__________________
my website?|ubuntu linux|get Firefox|grazie Polonia |bagdad sour
"Come va che non ha le corna e le zampe di Caprone?" gli opposi. "Oh, Giuvà", mi disse il prete "adesso non si usa più.Satana è furbo". (I.Silone, Fontamara)
"Al giorno d'oggi non bisogna essere intelligenti, perchè la gente si offende" (un ubriacone)
"close your eyes / pay the price / for your paradise" (DM) "whatever you want to change/you'd better start changing it in your mind" (Transatlantic)
|
|
30-01-2004 17:49 |
|
|
|  |
 |
korn |
| Lavorando con entrambi penso di potermi permettere ... |
30-01-2004 18:55 |
|
 |
korn |
SET FIRE!

Registered: Jun 2002
Posts: 5793 (0.67 al dì)
Location: Milano
Corso: Comunicazione Digitale
Anno: 1°! ....fuori corso :(
Time Online: 37 Days, 5:56:42 [...]
Status: Offline
Edit | Report | IP: Logged |
Lavorando con entrambi penso di potermi permettere di dire che PHP è migliore, tuttavia in Italia c'è ancora troppa chiusura mentale verso linux, opensource & soci.
Quando sono io a dover scegliere o proporre punto su PHP, ma se i clienti insistono per avere il sito in ASP sinceramente non oppongo granché di resistenza.
__________________
» Collect some stars to shine for you, and start today ‘cause there are only a few. _ (In Flames)
» Don't stop for nothing, it's full speed or nothing! I'm taking down, you know, whatever is in my way! _ ('tallica)
» I am my own god, I do as I please. _ (Pain)
» Ninetynine, ninetynine knives! Ninetynine knives inside! Nobody gets out alive! _ (The Haunted)
Web: http://www.negativesignal.com - ICQ# 171585477 - Death to software patents! And TCPA too! "e uno!", diceva il boia.
|
|
30-01-2004 18:55 |
|
|
|  |
 |
Rocco.Li |
| Un'altra guerra di religione ? o l'ennesima crocia ... |
30-01-2004 21:41 |
|
 |
Rocco.Li |
38 Primavere, Dottore !

Registered: Sep 2003
Posts: 609 (0.07 al dì)
Location: BARLASSINA (MI)
Corso: COMUNICAZIONE DIGITALE
Anno: Finitooooo !!!!
Time Online: 8 Days, 2:31:26 [...]
Status: Offline
Edit | Report | IP: Logged |
Un'altra guerra di religione ? o l'ennesima crociata per tutto cio che e' targato microsoft ?
Un bel CHISSENEFREGA su cosa e' meglio ?
e come discutere se e piu' buono il gelato alla fragola o quello ai frutti di bosco...
__________________
Alcuni uomini vedono le cose come sono e dicono: << Perche' ? >>
Io sogno le cose come non sono mai state e dico: << Perche' No ? >>
George Barnard Shaw, Commediografo.
"non preoccuparti troppo, comunque vada la vita, non ne uscirai vivo !" - anonimo
|
|
30-01-2004 21:41 |
|
|
|  |
 |
dan |
| [QUOTE][i]Originally posted by GaL3n [/i]
... |
01-02-2004 13:24 |
|
 |
dan |
..: Dottore :..

Registered: Oct 2002
Posts: 2446 (0.29 al dì)
Location: MI
Corso: Info
Anno: 3
Time Online: 11 Days, 7:56:39 [...]
Status: Offline
Edit | Report | IP: Logged |
Originally posted by GaL3n
Sicuramente quella di RIPe funge senza problemi in ogni:
<%
Dim bytetotali
Dim binario
Dim I, S
bytetotali = request.totalbytes
if bytetotali < 1000000 then
binario = request.BinaryRead(request.TotalBytes)
For I = 1 To LenB(binario)
S = S & Chr(AscB(MidB(binario, I, 1)))
Next
SimpleBinaryToString = S
else
Dim cl1, cl2, cl3, pl1, pl2, pl3
Dim L
cl1 = 1
cl2 = 1
cl3 = 1
L = LenB(binario)
Do While cl1<=L
pl3 = pl3 & Chr(AscB(MidB(binario,cl1,1)))
cl1 = cl1 + 1
cl3 = cl3 + 1
If cl3>300 Then
pl2 = pl2 & pl3
pl3 = ""
cl3 = 1
cl2 = cl2 + 1
If cl2>200 Then
pl1 = pl1 & pl2
pl2 = ""
cl2 = 1
End If
End If
Loop
S = pl1 & pl2 & pl3
end if
Const ForReading = 1, ForWriting = 2
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("c:\temp\fileprova.txt", ForWriting, True)
f.Write S
f.close
response.write "Ho ricevuto : " & bytetotali & " byte"
%>
E come faccio a dirgli in che directory mettere il file?
Per i permessi come funziona?
Grazie, D.
|
|
01-02-2004 13:24 |
|
|
|  |
 |
ripe |
| [QUOTE][i]Originally posted by fabpicca [/i]
... |
01-02-2004 19:49 |
|
 |
ripe |
- up in the mountains -

Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline
Edit | Report | IP: Logged |
Originally posted by fabpicca
su quali basi lo dico?
test di performance ne trovi ovunque.
comunque...
potrebbe bastare se ti dicessi ad esempio che le variabili GET e POST sono passate come variabili globali e non necessitano di essere estratte da oggetti request?
o ad esempio che prima di attivare un server IIS ci penserei due volte visti gli enormi problemi di sicurezza, quando invece apache è il miglior webserver sistente per prestazioni e sicurezza?
o magari questa come la vedi?
PHP è gratuito.ASP si paga...a meno che non fai il furbo, certo...
Terrificante. Sono dei punti talmente critici da rendere SCHIACCIANTE la superiorità di php rispetto ad asp. Avevi ragione.

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»
|
|
01-02-2004 19:49 |
|
|
|  |
 |
Rocco.Li |
| Terrificante davvero.
... |
02-02-2004 15:25 |
|
 |
Rocco.Li |
38 Primavere, Dottore !

Registered: Sep 2003
Posts: 609 (0.07 al dì)
Location: BARLASSINA (MI)
Corso: COMUNICAZIONE DIGITALE
Anno: Finitooooo !!!!
Time Online: 8 Days, 2:31:26 [...]
Status: Offline
Edit | Report | IP: Logged |
Terrificante davvero.
Il gelato alla fragola devi pagarlo...
...quello ai frutti di bosco ha i lamponi globali sopra !!!
ah, devi essere anche aperto mentalmente per mangiarlo...
Wow quasi quasi da oggi mangio solo il gelato al gianduja (JSP)...
__________________
Alcuni uomini vedono le cose come sono e dicono: << Perche' ? >>
Io sogno le cose come non sono mai state e dico: << Perche' No ? >>
George Barnard Shaw, Commediografo.
"non preoccuparti troppo, comunque vada la vita, non ne uscirai vivo !" - anonimo
|
|
02-02-2004 15:25 |
|
|
|  |
 |
dan |
| [QUOTE][i]Originally posted by Rocco.Li [/i]
... |
16-02-2004 08:32 |
|
 |
dan |
..: Dottore :..

Registered: Oct 2002
Posts: 2446 (0.29 al dì)
Location: MI
Corso: Info
Anno: 3
Time Online: 11 Days, 7:56:39 [...]
Status: Offline
Edit | Report | IP: Logged |
Originally posted by Rocco.Li
Terrificante davvero.
Il gelato alla fragola devi pagarlo...
...quello ai frutti di bosco ha i lamponi globali sopra !!!
ah, devi essere anche aperto mentalmente per mangiarlo...
Wow quasi quasi da oggi mangio solo il gelato al gianduja (JSP)...
?
|
|
16-02-2004 08:32 |
|
|
|  |
 |
Rocco.Li |
| [QUOTE][i]Originally posted by dan [/i]
... |
16-02-2004 11:08 |
|
|
|  |
 |
| All times are GMT. The time now is 04:57. |
|
|
 |
|
 |
|
|
|  |
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|