dongping4461 2015-05-18 21:20
浏览 163

从cordova文件传输上传获取http_statust 408

i cant seem to upload image on from cordova using filetransfer to apache server running lamp stack always keep getting http_status : 408 and error code 3 from file transfer im running cordova 3.5 which has file plugin 1.2.0 and filetransfer plugin 0.4.4

here is the code

$scope.transferFile = function (imageURI) {
    console.log(imageURI);
    //imageURI = imageURI.substr(8, imageURI.length);
    //imageURI = 'file://' + imageURI;
    //console.log(imageURI);

    var options = new FileUploadOptions();

    options.fileKey="file";
    options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
    options.mimeType="image/jpeg";
    options.chunkedMode = false;
    options.headers = {
        Connection: "close"
    };

    // setup parameters
    var params = {};
    params.fullpath =imageURI;
    params.name = options.fileName;



    var ft = new FileTransfer();

    ft.upload(imageURI, encodeURI('http://www.exoplace.com/uploads/upload.php'), win, fail, options);

}

here is image taking code

        var type;
    if (t == "gallery") {
        type = Camera.PictureSourceType.PHOTOLIBRARY;
    } else {
        type = Camera.PictureSourceType.CAMERA;
    }
    navigator.camera.getPicture($scope.transferFile, $scope.uploadFailed, {
        quality: 90,
        destinationType: Camera.DestinationType.FILE_URI,
        sourceType: type,
        allowEdit: true,
        encodingType: Camera.EncodingType.JPEG,
        targetWidth: 500,
        targetHeight: 500,
        saveToPhotoAlbum: true
    });

on server i just keep empty php page called upload.php which returns some random string and does nothing.

the server code is

echo 'test'

any idea is it server or client problem?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度