I hope you can help.
I'm writing a plugin to allow users to export straight to a webservice written in asp.net.
here are the params needed.
http://barnaland.is/dev/DataStorage.asmx?op=AddFile
I've played with the sample plugins in the sdk be able to get usertoken etc.. so I seem to be able to cover all but the acutal upload.
now how do I change this so the webservice gets all the params needed?
local postUrl = ''
info( 'uploading photo', params.filePath )
local filePath = assert( params.filePath )
params.filePath = nil
local fileName = LrPathUtils.leafName( filePath )
params.auth_token = params.auth_token or prefs.token
params.api_sig = FlickrAPI.makeApiSignature( params )
local mimeChunks = {}
for argName, argValue in pairs( params ) do
if argName ~= 'api_sig' then
mimeChunks[ #mimeChunks + 1 ] = { name = argName, value = argValue }
end
end
mimeChunks[ #mimeChunks + 1 ] = { name = 'api_sig', value = params.api_sig }
mimeChunks[ #mimeChunks + 1 ] = { name = 'photo', fileName = fileName, filePath = filePath, contentType = 'application/octet-stream' }
-- Post it and wait for confirmation.
local result = LrHttp.postMultipart( postUrl, mimeChunks )
I hope you can help.