Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

HiTech-SP

Exemplo de upload

Recommended Posts

Estou desenvolvendo um sistema de upload, meu server suporta sa filesup e dundas.alguem teria um exemplo de upload num desses 2 objetos ?obrigado pela atençãoHiTech-SP

Compartilhar este post


Link para o post
Compartilhar em outros sites

Já tentou ver na página de suporte deles?

Dundas, esse eu sei que tem exemplo!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Compartilhar este post


Link para o post
Compartilhar em outros sites

Do help deles:

 

Example<%'most control methods throw an exception if an error occurs so we will use an' On Error Resume Next statement for error trapping purposesOn Error Resume Next'create an instance of the Upload controlSet objUpload = Server.CreateObject ("Dundas.Upload.2")'we will save all uploaded data (form data as well as any uploaded files) to disk.'note that we could also save the uploaded files to memory with the SaveToMemory method.'also note that both the Save and SaveToMemory methods populate the Form and' Files collections with one method call.'its also important to realize that by default files saved to disk will have unique filenames, but' this can be changed with the UseUniqueNames propertyobjUpload.Save "c:\temp\"'check to see if method call was successful using VBScript's Err object, if ' an error occurred we will redirect user to a fictitious error pageIf Err.Number <> 0 ThenResponse.Redirect "Error.asp"Else'use a For Each loop and check to see if the uploaded file is an' executable (utilizing VBScript's InStr method), if it is delete it from disk.'but first we will output the name of the file input box(es) responsible for uploadsFor Each objUploadedFile in objUpload.FilesResponse.Write "The "" & objUploadedFile.TagName & "" file input box was used to upload a file.<br>"If InStr(1,objUploadedFile.ContentType,"octet-stream") Then'if the default web account does not have the right to delete files' for the folder you save uploaded files to (in this case c:\temp) then you can either set' the required rights manually or you could use the ImpersonateUser methodobjUploadedFile.DeleteEnd IfNext'we will just output the name of the populated form elements and their valuesFor Each objFormItem In objUpload.FormResponse.Write "<br>The name of the form item is: " & objFormItemResponse.Write "<br>The value of the form item is: " & objFormItem.Value & "<br>"NextEnd If'Release resourcesSet objUpload = Nothing%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.