HTML로 업로드 기능을 사용했습니다. 주어진 코드를 사용하면 잘 작동합니다.Flex에서 URLRequest를 사용하여 파일 업로드가 작동하지 않습니다.
<input type="file" name="filedata" />
<input type="submit" name="button" value="upload"//form
같은 기능 내가 플렉스에서 시도 :
var uploadURL:URLRequest = new URLRequest();
uploadURL.url="http://localhost:8080/alfresco/service/slingshot/profile/uploadavatar?alf_ticket=TICKET_7475e180e8d258c0341fc745a3a35274d0a06e50"";
uploadURL.method=URLRequestMethod.POST;
uploadURL.contentType="multipart/form-data";
var params:URLVariables = new URLVariables();
params.username ="admin";
params.filedata=fileRef.data;
uploadURL.data = params;
fileRef.upload(uploadURL)
하지만 얻기 잘못된 요청 오류
<form id="avatar" enctype="multipart/form-data"
action="http://localhost:8080/alfresco/service/slingshot/profile/uploadavatar?
alf_ticket=TICKET_7475e180e8d258c0341fc745a3a35274d0a06e50"
method="post">
<input type="text" name="username" value="ken"/>
는 파일을 선택합니다. 그래서 아무도, 코드에서 내가 잘못 했어. 나와 공유하십시오.
서버에 무엇을 보내고 있는지 확인 했습니까? www.charlesproxy.com을 설치하고 요청 및 응답 개체의 내용을 확인하십시오. 희망이 도움이됩니다. – Simsons