문제

사용자가 파일을 업로드 할 수있는 매우 간단한 업로드 된 페이지가 있습니다. 파일을 업로드 할 수 있습니다. 로컬 컴퓨터에서 실행할 때 아름답게 작동합니다. http : // localhost/project/etc

문제는 MachineName을 통해 얻으려고하더라도 LocalHost 외부에서 동일한 물건에 액세스하려고 할 때입니다.http : // mycomp1/project/etc), 페이지가로드/등을로드하고 모든 것이 작동하는 것처럼 보이지만 아무것도 전송되지 않습니다. FireBug가 열려 있고 일반적으로 AJAX 요청이 표시되지만 아무것도 얻지 못합니다.

어떤 아이디어?

내 업로드 코드 :

$('#uploadify').uploadify({
    'scriptAccess': 'always',
    'uploader': '../../scripts/uploadify.swf', //flash source for handling the uploads and size checking
    'cancelImg': '../../content/images/cancel.png', //cool cancel button
    'script': '../../' + $('#Controller').val() + '/FileSave/' + $('#OrderID').val(), //sends files to the controller with apropriate data
    'folder': 'Uploads', //sets the upload directory, not sure if this matters as the files are sent to the controller
    'multi': true, //allows multiple uploads
    'auto': false, //uploads dont start automatically
    'queueSizeLimit': 5, //5 files can be in the queue at a time
    'queueID': 'fileQueue', //div to contain the queue of files
    'displayData': 'speed', //shows the transfer speed
    'fileExt': '*.pdf', //limits to pdfs
    'fileDesc': 'PDF', //shows a description in the browse window of filetypes
    'sizeLimit': '5242880', //5mb limit
    'scriptData': { 'CategoryID': $('#fileCategory').val() }, //passes the selected value of the category drop down
    onComplete: function(event, queueID, fileObj, response, data) {//once a transfer completes fires an ajax function to pull in the files for the order 
        if (response == "Upload Successful") {//if response is successfull, updates div displaying files with new files
            GetFiles($('#Controller').val());
        }
    }
});

업데이트 : ScriptAccess 설정이있는 것으로 보이지만 항상 설정되어 있어도 업로드 웹 사이트에서 언급했듯이 여전히 백엔드 스크립트 또는 내 컴퓨터 기능을 발사하지 않습니다.

Update2 : 추가 검사에서 내 스크립트 경로가 비 지역 호스트 설정에있을 때 내 스크립트 경로가 올바르지 않은 것처럼 보이지만 이제는 올바른 위치에 스크립트가 있으면 oncomplete 기능에서 얻는 응답 IM이 로그인 페이지의 HTML 출력과 동일합니다. 어떤 아이디어?

Update3 : 내 스크립트 경로가 정상인 것처럼 보입니다. LocalHost에서 어떤 이유로 든 제 성공 또는 업로드 대신 내 로그인 페이지의 응답을 얻거나 백엔드 코드에서 실패했습니다.

도움이 되었습니까?

해결책

로그인 페이지 문제의 경우 플래시가 세션을 존중하지 않는 것 같습니다.

PHP를 사용하고 있다고 가정하면 Flash 객체에서 게시물에 PHP SessionID를 통과해야합니다. 예를 들어 SWF 업로드 이것은 그것을 전달함으로써 이루어집니다 post_params 설정. 그런 다음 세션을 시작하기 전에 다음과 같은 일을하십시오.

if( isset( $_POST['session_id'] ) && !empty( $_POST['session_id'] ) )
    session_id( $_POST['session_id'] )

session_start();

편집 : 방금 ASP 태그를 발견했습니다. ASP의 플래시 세션에 관한이 기사를 찾았습니다. 잘만되면 그것은 도움이 될 것입니다.

http://swfupload.org/forum/generaldiscussion/98

편집 : 일부 업로드 + ASP 특정 정보.

http://www.uploadify.com/forum/viewtopic.php?f=7&t=1178

정말 유망한 것 같습니다 :::

ASP.NET MVC 및 인증과 함께 플래시 사용

다른 팁

~ 같은 문제가 있었고 해결책은 매우 사소했습니다 - 추가 crossdomain.xml 웹 서버의 보이는 루트 폴더에 업로드가 액세스 중입니다. 다음 정보를 포함해야합니다

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="yourdomain"/>
</cross-domain-policy>   

또한 나는 당신이 읽는 것을 조언합니다 이 설명서 이 파일의 요점을 더 잘 이해하기 위해.

이것이 문제의 근본인지 확인하려면이 방법을 시도해보십시오.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top