2
我有一個使用拖放在我的桌面Flex 4.6應用程序中的視圖創建的zip文件。使用HTTP POST通過動作上傳一個zip文件3.0
這會觸發一個將自動上傳zip文件的服務。
我能夠使用下面的代碼發送有關zip文件的元數據到服務器。
var urlRequest:URLRequest = new URLRequest(PUBLISH_ZIP_FILE_URL);
// set to method=POST
urlRequest.method = URLRequestMethod.POST;
var params:URLVariables = new URLVariables();
params['data[File][title]'] = 'Title1';
params['data[File][description]'] = 'desc';
// params['data[File][filename]'] = I am not sure exactly what to use here
// If this is a webpage, I expect to use input type="file" with the name as data[File][filename]
urlRequest.data = params;
addLoaderListeners();
// set it such that data format is in variables
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.load(urlRequest);
我已閱讀https://stackoverflow.com/questions/8837619/using-http-post-to-upload-a-file-to-a-website
然而,他們立刻開始了與ByteArray的,這我不知道如何轉換我的zip文件的。
請指教。
感謝更新 – hooleyhoop
如果這對你的工作,你應該能夠接受自己的答案,只是幫助清理名單未回答VS回答。 – shaunhusain
@shaunhusain也許你不知道。但是在接受自己對自己問題的答案方面存在時間延遲。除非48小時之後,否則我不能接受。 –