我需要使用多部分请求将图像文件从Lightroom发送到使用Lua语言的本地web服务。
我也测试过使用发送报头,但不起作用……
我创建了一个函数:
function testupload(filepath) --created inside LrTasks
local url = "http://localhosturl"
local mycontent = {
{
name = "lightroom_message",
value = "sent from lightroom plugin multiparta"
},
{
name = 'file',
filePath = filepath,
fileName = LrPathUtils.leafName(filepath),
contentType = 'image/jpeg'
--contentType = 'multipart/form-data'
}
}
local response, headers = LrHttp.postMultipart(url, mycontent)
结束
但是我的web服务没有被正确调用,我正在使用LrHttp.postMultipart()方法来调用它。
如果我只将此参数发送到web服务(然后工作正常):
{
name = "lightroom_message",
value = "sent from lightroom plugin multiparta"
}
但是,当我包含我的文件有效负载时,它不能使用纯Lua实现。
发布于 2016-04-12 12:11:59
一切都是正确的,但只是一个技术错误……我试图从LRtasks..but内部调用testupload()函数,我们不需要在单独的任务中调用它,该函数工作得很好。
https://stackoverflow.com/questions/36514006
复制相似问题