Jump to content
Fórum Script Brasil
  • 0

Upload Com Webservices


Question

olá pessoal peguei um exemplo de upload na net com web services

mas eu até agora estou apanhando desse script

chamando o web services

dim 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 isso

qual dado eu tenho que passar aqui nesse objfile e como eu faço para converter

UploadFile(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 Function

quem poder me ajudar. .eu agradeço

meu email/MSN [email protected]

Link to post
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Cloud Computing


  • Forum Statistics

    • Total Topics
      148724
    • Total Posts
      644561
×
×
  • Create New...