Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21237

[RESOLVED] [VB6] upload file to Dropbox

$
0
0
Hi.

How can I upload a file to my Dropbox public folder (https)?

I can download perfectly with Inet and this function:
Code:

Public Sub DownloadFile(strURL As String, strDestination As String)
    Const CHUNK_SIZE As Long = 1024
    Dim intFile As Integer
    Dim lngBytesReceived As Long
    Dim lngFileLength As Long
    Dim strHeader As String
    Dim b() As Byte
   
    DoEvents
   
    With Inet2
   
    .URL = strURL
    .Execute , "GET", , "Range: bytes=" & CStr(lngBytesReceived) & "-" & vbCrLf
   
    While .StillExecuting
    DoEvents
    Wend
   
    strHeader = .GetHeader
    End With
   
    strHeader = Inet2.GetHeader("Content-Length")
    lngFileLength = Val(strHeader)
   
    DoEvents
   
    lngBytesReceived = 0
   
    intFile = FreeFile()
   
    Open strDestination For Binary Access Write As #intFile
   
    Do
    b = Inet2.GetChunk(CHUNK_SIZE, icByteArray)
    Put #intFile, , b
    lngBytesReceived = lngBytesReceived + UBound(b, 1) + 1
   
    Loop While UBound(b, 1) > 0
   
    Close #intFile

End Sub

But now I need to UPload.

Viewing all articles
Browse latest Browse all 21237

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>