Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Forum De Bell Tolls > [web] Upload ASP
Pages (2): [1] 2 »   Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
dan
..: Dottore :..

User info:
Registered: Oct 2002
Posts: 2446 (0.29 al dì)
Location: MI
Corso: Info
Anno: 3
Time Online: 11 Days, 7:56:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Exclamation 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
Click Here to See the Profile for dan Click here to Send dan a Private Message Visit dan's homepage! Find more posts by dan Add dan to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
[D]ani[J]
dsy moderator

User info:
Registered: Aug 2003
Posts: 1380 (0.17 al dì)
Location:
Corso: F47
Anno:
Time Online: 17 Days, 14:25:28 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

prova a buttare un'occhio QUA

__________________
Dani
e-mail: DaniJ@dsy.it
...ahhh ste donne! :D
Buoniiiiiisssimaaaa!

29-01-2004 17:49
Click Here to See the Profile for [D]ani[J] Click Here to See the Blog of [D]ani[J] Click here to Send [D]ani[J] a Private Message Find more posts by [D]ani[J] Add [D]ani[J] to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
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

Post actions:

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
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
GaL3n
Ninja Bisbetico

User info:
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

Post actions:

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
Click Here to See the Profile for GaL3n Click Here to See the Blog of GaL3n Click here to Send GaL3n a Private Message Visit GaL3n's homepage! Find more posts by GaL3n Add GaL3n to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fabpicca
jesus robot d'acciaio

User info:
Registered: May 2002
Posts: 2166 (0.25 al dì)
Location: Pieve Emanuele
Corso: Ticom
Anno:
Time Online: 12 Days, 23:12:28 [...]
Status: Offline

Post actions:

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
Click Here to See the Profile for fabpicca Click Here to See the Blog of fabpicca Click here to Send fabpicca a Private Message Visit fabpicca's homepage! Find more posts by fabpicca Add fabpicca to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
dan
..: Dottore :..

User info:
Registered: Oct 2002
Posts: 2446 (0.29 al dì)
Location: MI
Corso: Info
Anno: 3
Time Online: 11 Days, 7:56:39 [...]
Status: Offline

Post actions:

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
Click Here to See the Profile for dan Click here to Send dan a Private Message Visit dan's homepage! Find more posts by dan Add dan to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
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

Post actions:

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... :asd:

:roll:

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

30-01-2004 16:00
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fabpicca
jesus robot d'acciaio

User info:
Registered: May 2002
Posts: 2166 (0.25 al dì)
Location: Pieve Emanuele
Corso: Ticom
Anno:
Time Online: 12 Days, 23:12:28 [...]
Status: Offline

Post actions:

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
Click Here to See the Profile for fabpicca Click Here to See the Blog of fabpicca Click here to Send fabpicca a Private Message Visit fabpicca's homepage! Find more posts by fabpicca Add fabpicca to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
korn
SET FIRE!

User info:
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

Post actions:

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
Click Here to See the Profile for korn Click Here to See the Blog of korn Click here to Send korn a Private Message Visit korn's homepage! Find more posts by korn Add korn to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Rocco.Li
38 Primavere, Dottore !

User info:
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

Post actions:

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
Click Here to See the Profile for Rocco.Li Click Here to See the Blog of Rocco.Li Click here to Send Rocco.Li a Private Message Find more posts by Rocco.Li Add Rocco.Li to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
dan
..: Dottore :..

User info:
Registered: Oct 2002
Posts: 2446 (0.29 al dì)
Location: MI
Corso: Info
Anno: 3
Time Online: 11 Days, 7:56:39 [...]
Status: Offline

Post actions:

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
Click Here to See the Profile for dan Click here to Send dan a Private Message Visit dan's homepage! Find more posts by dan Add dan to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
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

Post actions:

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.
































:rotfl:

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

01-02-2004 19:49
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Rocco.Li
38 Primavere, Dottore !

User info:
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

Post actions:

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
Click Here to See the Profile for Rocco.Li Click Here to See the Blog of Rocco.Li Click here to Send Rocco.Li a Private Message Find more posts by Rocco.Li Add Rocco.Li to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
dan
..: Dottore :..

User info:
Registered: Oct 2002
Posts: 2446 (0.29 al dì)
Location: MI
Corso: Info
Anno: 3
Time Online: 11 Days, 7:56:39 [...]
Status: Offline

Post actions:

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)...


:cannabis: ?

16-02-2004 08:32
Click Here to See the Profile for dan Click here to Send dan a Private Message Visit dan's homepage! Find more posts by dan Add dan to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Rocco.Li
38 Primavere, Dottore !

User info:
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

Post actions:

Edit | Report | IP: Logged

Originally posted by dan
:cannabis: ?


:prr::prr::prr::prr::prr::prr::prr::prr::prr::prr:
:prr::prr::prr::prr::prr::prr::prr::prr::prr::prr:
:prr::prr::prr::prr::prr::prr::prr::prr::prr::prr:
:prr::prr::prr::prr::prr::prr::prr::prr::prr::prr:
:prr::prr::prr::prr::prr::prr::prr::prr::prr::prr:
:prr::prr::prr::prr::prr::prr::prr::prr::prr::prr:
:prr::prr::prr::prr::prr::prr::prr::prr::prr::prr:
:prr::prr::prr::prr::prr::prr::prr::prr::prr::prr:
:prr::prr::prr::prr::prr::prr::prr::prr::prr::prr:
:prr::prr::prr::prr::prr::prr::prr::prr::prr::prr:
:prr::prr::prr::prr::prr::prr::prr::prr::prr::prr:
:prr::prr::prr::prr::prr::prr::prr::prr::prr::prr:
:prr::prr::prr::prr::prr::prr::prr::prr::prr::prr:
:prr::prr::prr::prr::prr:

__________________
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

16-02-2004 11:08
Click Here to See the Profile for Rocco.Li Click Here to See the Blog of Rocco.Li Click here to Send Rocco.Li a Private Message Find more posts by Rocco.Li Add Rocco.Li to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 04:57.    Post New Thread    Post A Reply
Pages (2): [1] 2 »   Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

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
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.106 seconds (42.77% PHP - 57.23% MySQL) con 25 query.