The goal is to create a simple website with an [login to view URL] page that can upload a local file that is already present on the server to a distant Dropbox folder. We have an IIS server. On this server are about 1000 documents in a single folder that need to be uploaded. We have tried to solve the problem inside the host site with some code solution. But we have not been able to make that work, so thought a simple solution would be to create a simple aspx page.
Actually code section we have :
The aspx code :
<asp:FileUpload ID="FileUpload1" runat="server" accept="application/msword,application/[login to view URL],application/pdf" />
<asp:RegularExpressionValidator ID="uplValidator" runat="server" ControlToValidate="FileUpload1"
ErrorMessage="only .pdf, .doc, docx, .odt, .txt formats are allowed"
<asp:Button ID="btnsave" runat="server" onclick="btnsave_Click" Text="Save"/>
The code behind :
Protected Sub btnsave_Click(ByVal sender As Object, ByVal e As [login to view URL])
Upload(folderPath & filename, filename) 'Here the path and the folder is an existing file on my server.
Sub Upload(ByVal filePath As String, ByVal targetFileName As String)
Dim dbx As DropboxClient
dbx = New DropboxClient("<the Token Generated>")
Dim fileStream As Object
fileStream = New FileStream(filePath, [login to view URL], [login to view URL])
Dim content As Byte()
Using reader As Object = New BinaryReader(fileStream)
content = [login to view URL](CInt([login to view URL]))
Using mem As New MemoryStream(content)
[login to view URL]("<path on dropbox side>"&targetFileName , [login to view URL], body:=mem)
I don't know is anything is wrong in this code ? Actually I don't really know how the "<path on dropbox side>" should look like.
This code don't generate any error for my tests, just no files are created on my dropbox depot.
hello, please share your code here for review. there are 2 types of API key, private and public. I think your code mixed between both. let me know as this will be a very quick solution. regards khamid
22 freelancers are bidding on average $138 for this job
Hi There, Thank you for providing the code for jump start. I would be needing the access code to check and execute the code properly. Let's connect over chat to get started on the project. Regards, Shobhit Pundir
Dear client. Nice to meet you. I've read you project description carefully and very interested. Let's discuss over chat and get started. Waiting your reply. Warm regards.