Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6620747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:08:34+00:00 2026-05-25T21:08:34+00:00

I wrote a client for my server based on jquery mobile. I just cannot

  • 0

I wrote a client for my server based on jquery mobile. I just cannot figure out how to transfer photos to my server because when I use GET method to post base64 strings, the server says the URI is too long.

So I tried to move the webpages and scripts to server and left a local file to redirect to server page. But right now, I can take photos but there seems have no callback when I finished.

Here is what I did

var imgTakePhotoStatusBase64="Wyk+HjAxHTAyNzg3MDUdODQwHTAxOR0wMDAwMDAwMDAwMDAwMDAdRkRFQh0wMDAwMDAwHTA0MB0dMS8xHTUwLjVMQh1OHVcgMzR0aCBTdHJlZXQdQXVzdGluHVRYHSAeMDYdMTBaR0QwMDQdMTFaUmVjaXBpZW50IENvbXBhbnkgTmFtZR0xMlo5MDEyNjM3OTA2HTE0WioqVEVTVCBMQUJFTCAtIERPIE5PVCBTSElQKiodMjNaTh0yMlocWR0yMFogHDAdMjZaNjEzMxwdHgQ=";

function TextStatus(){
        var s=window.prompt("","请输入广播的内容");
        if(s!=null&&s!=""){
                SetStaus(s);
        }
}

$("#pageTakePhotoStatus").live("pageshow", function() {
        TakePhotoStatus()
});

function TakePhotoStatus(){
        imageData="";
        navigator.camera.getPicture(onTakePhotoStatusSuccess, onTakePhotoStatusFail, { quality: 75 });
}

function onTakePhotoStatusSuccess(imageData) {
    var image = document.getElementById('imgTakePhotoStatus');
    image.src = "data:image/jpeg;base64," + imageData;
        imgTakePhotoStatusBase64=imageData;
}

function onTakePhotoStatusFail(message) {
    alert('获取照片失败,因为: ' + message);
}

function TakePhotoStatusOk(){
        try
        {
                var myDate = new Date();
        var r=myDate.getTime();
                var path="uploads.share/"+r+"/"+r+".jpg";
            doMethod("ImageUploadByBase64String","{'str':'"+e(imgTakePhotoStatusBase64)+"','path':'"+e(path)+"'}",null,
        function(result){
                            doMethod("PublishPhotoes","{'located':'false','path':'"+e(path)+"','text':'"+e("描述:"+$("#txaTakePhotoStatusDes").val())+"'}",null,
                function(r){
                    alert("您的照片已经发布");
                                        history.back();
                });
        });
        }catch(err)
        {
        alert(err.description);
        }
}

But onTakePhotoStatusSuccess doesn’t work when I take a photo. When I run it in local, it is just fine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:08:35+00:00Added an answer on May 25, 2026 at 9:08 pm

    Camera works with phonegap, so if the user has your code running as an app it’s ok.
    It won’t work as a webapp, because there’s no phonegap then.

    Now the main issue:
    POST might refuse to work cross-domain (not sure if phonegap can be set to allow it). If you can – use POST. If not, read:

    GET can hold as much data as the browser is willing to send and the server is willing to catch. There is no standard. IE sends 2048 characters (2kb), FF sends over 100kb etc.
    You have to test your server and maybe configure it to accept large GET queries.

    Now the fun part – if you know the length of GET that is avaliable to you, you can transfer data in chunks.

    1. get length of data and divide by chunk length
    2. send the result as the first query so that the server knows how many chunks to expect
    3. send N more queries with chunks of data

    Why not send and then confirm that it’s all done? Well, it’s asynchronous, so you never know.

    This works. I did some different implementations of sending lots of data cross-domain with JSONP

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a client-server application in Java with an XML-based protocol. But
I wrote a server-client rmi application and I'm using MacOsX and Ubuntu laptops to
I wrote a makefile: all: server client server: server.o des.o sha1.o /usr/local/arm-2009q1/bin/arm-none-linux-gnueabi-gcc -o server
I wrote an XML RPC server in python and a simple Test Client for
I wrote a server based on Twisted, and I encountered a problem, some of
I recently wrote a small AJAX-based chat program. The clients ping the server occasionally
I am writing a markdown compiler in Erlang for server-side use. Because it will
I'm looking to write a small client-server-based text game that handles multiple client connections
I am trying to make a client/server turn based game. I want this to
I want to build a web-based irc client with JQuery. I know I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.