Hello,
I'm trying to incorporate Piwigo file sync on my vb program I got the pwg.session.login, pwg.session.status and pwg.images.checkUpload working, but I can't get the pwg.images.upload to work (err 501, missing method name. I just wonder if anybody have this implementation on vb or c#.
Here is the code:
working:
'\\\\\\\\\\\\\\\\\\\\\\ Login PIWIGO /////////////////////
Public Function PWGAuthentication() As String
PWGUrl = "http://www.praecones.org/photos/ws.php?format=json"
PWGMethod = "method=pwg.session.login"
PWGusername = "user"
PWGpassword = "password"
Set xmlhttp = CreateObject("Msxml2.ServerXMLHTTP")
xmlhttp.open "POST", PWGUrl, False
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlhttp.send PWGMethod & "&username=" & PWGusername & "&password=" & PWGpassword
PWGAuthentication = xmlhttp.responseText
End Function
Not Working:
'\\\\\\\\\\\\\\\\\\\\\\ PIWIGO File Upload /////////////////////
Public Function PWGUploadFile() As String
PWGUrl = "http://www.praecones.org/photos/ws.php?format=rest"
PWGMethod = "method=pwg.images.upload"
PWGFile = "c:\pwg\P10100011.jpg"
xmlhttp.open "POST", PWGUrl, False
xmlhttp.setRequestHeader "Content-Type", "multipart/form-data"
xmlhttp.send "method=pwg.images.upload&image=c:\pwg\P10100011.jpg&pwg_token=" & PWGToken
PWGUploadFile = xmlhttp.responseText
End Function
Piwigo version: 2.7.4
PHP version: 5.6.29
MySQL version: 5.6.32-78.1
Piwigo URL: http://www.praecones.org/photos/ws.php
Offline
Here's a C# example, but is uses .AddSimple not .upload. Nevertheless, perhaps it will be useful to you. See function SyncPiwigoAddPhoto().
http://piwigo.org/svn/extensions/Picasa … tusForm.cs
Offline
Hi kenl
Yes! this will help a lot. I will try that asap
Thank you very much.
Offline