upload com web services
olá pessoal peguei um exemplo de upload na net com web servicesmas eu até agora estou apanhando desse scriptchamando o web servicesdim aService1 as new Service1() dim ss as byte = Convert.ToBase64String(myFile.PostedFile) dim aBoolean as Boolean = aService1.UploadFile(myFile.PostedFile.Filename, ss, "C:\Inetpub\wwwroot\web\arquivos\", "")tipo queria saber qual informação.. eu passo nesse parametro e como faço para fazer issoqual dado eu tenho q passar aqui nesse objfile e como eu faço para converterUploadFile(ByVal strFileName As String, ByVal objFile As Byte(), ByVal strCaminho As String, ByVal strReturn As String)Public Function UploadFile(ByVal strFileName As String, ByVal objFile As Byte(), ByVal strCaminho As String, ByVal strReturn As String) As Boolean Dim bolReturnStatus As Boolean = False Dim objFileStream As FileStream Try 'creates the file by opening and setting the fileaccess to write objFileStream = File.Open(strCaminho & strFileName, FileMode.Create, FileAccess.Write) 'byte count Dim lngLen As Long = objFile.Length 'Write the file objFileStream.Write(objFile, 0, CType(lngLen, Integer)) 'clears the buffer and writes any buffered data objFileStream.Flush() 'close the file so it can be access by other files objFileStream.Close() 'return a successful upload status bolReturnStatus = True Catch exc As System.UnauthorizedAccessException 'Account does not have enough access to create the file, do to either login or system permissions strReturn = "Unauthorized Access Exception Occurred. Error: " & exc.Message.ToString Catch exc As Exception 'catchall error handler strReturn = "Exception Occurred. Error: " & exc.Message.ToString Finally 'cleanup just in case If Not objFileStream Is Nothing Then objFileStream.Close() End If End Try Return bolReturnStatus End Functionquem poder me ajudar. .eu agradeçomeu email/msn trajanowilliam@msn.com
Discussão (1)
Carregando comentários...