|
-
Jul 31st, 2013, 08:40 PM
#1
Thread Starter
Member
[RESOLVED] [VB6] upload file to Dropbox
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.
-
Jul 31st, 2013, 08:52 PM
#2
Thread Starter
Member
Re: [VB6] upload file to Dropbox
I mean, it's very easy to GET from ftp and http.
I also can PUT to ftp very easy... It should be easy as well to PUT to http!
PS: I don't need to use Inet, I can use any way to upload to https
-
Jul 31st, 2013, 09:47 PM
#3
Re: [VB6] upload file to Dropbox
In order to upload there has to be something on the other end that will receive it and the method you use needs to be in accordance with what is expected by the server.
You say you can put very easy, why is it that you are not going that route?
-
Aug 1st, 2013, 04:01 AM
#4
Re: [VB6] upload file to Dropbox
The guts of what is required is documented at:
https://www.dropbox.com/developers/core/docs
There's a lot to deal with such as just for starters OAuth and JSON.
-
Aug 1st, 2013, 04:17 AM
#5
Re: [VB6] upload file to Dropbox
 Originally Posted by dilettante
At least that is well documented!
-
Aug 1st, 2013, 11:33 AM
#6
Re: [VB6] upload file to Dropbox
Dropbox isn't meant to be used silently as a datastore behind an application, as made clear by requirements such as:
Step 2 of authentication. Applications should direct the user to /oauth/authorize. This isn't an API call per se, but rather a web endpoint that lets the user sign in to Dropbox and choose whether to grant the application the ability to access files on their behalf. The page served by /oauth/authorize should be presented to the user through their web browser. Without the user's authorization in this step, it isn't possible for your application to obtain an access token from /oauth/access_token.
-
Aug 1st, 2013, 01:37 PM
#7
Thread Starter
Member
Re: [RESOLVED] [VB6] upload file to Dropbox
Now I get why I was having so much trouble.
For a moment I thought it was brilliant to replace my ftp server with Dropbox... now I see it was a poor illusion. I'm going back to ftp server.
Thank you!
Matter closed.
(Not entierly "resolved" but closed.)
-
Aug 1st, 2013, 04:43 PM
#8
Re: [RESOLVED] [VB6] upload file to Dropbox
The drop box folder maps locally to your USER folder - why were you doing all this when it's just a path on your machine anyway?
-
Aug 1st, 2013, 05:20 PM
#9
Thread Starter
Member
Re: [RESOLVED] [VB6] upload file to Dropbox
 Originally Posted by szlamany
The drop box folder maps locally to your USER folder - why were you doing all this when it's just a path on your machine anyway?
Because I wanted my software, which is in many other PC, to add a file to my Dropbox account instead of uploading it to a server.
-
Aug 1st, 2013, 07:24 PM
#10
Re: [RESOLVED] [VB6] upload file to Dropbox
Then why not make a "service" that is mapped to drop box - locally to itself - that sees your other PC's and does that upload??
Are you just looking free space - or a way to archive/backup information?
-
Aug 1st, 2013, 08:09 PM
#11
Re: [RESOLVED] [VB6] upload file to Dropbox
Might be anything: user feedback, errors, usage logs, or ... keylogger captures. 
The downsides of FTP are that people can grab your credentials easily using sniffers, firewalls often block it, and NAT issues can mean you have to support PASV mode FTP.
The downside of simple HTTP file transfer protocols is that even using SSL it is fairly easy for somebody to grab your credentials using a common tool like Fiddler.
This is why most advanced services put you through wringers like OAuth or more complex cryptographic credential approaches using HMAC. Even OAuth is weaker than you really want to use though.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|