javascript - Image upload in phonegap using Rest webservice in java -
i working phonegap + rest webservice. service given below working gud web application test. image file uploaded in local webserver. same service not working in phonegap. included both codes here.
restwebservice
@post @consumes(mediatype.multipart_form_data) public response uploadfile( @formdataparam("image") inputstream uploadedinputstream, @formdataparam("image") formdatacontentdisposition filedetail) { system.out.println("entered"); //some logic .. method working using webapplication ... tested using html page }
phonegap code
function mydetails() { var options = new fileuploadoptions(); options.filekey="file"; options.filename=imgbyte.substr(imgbyte.lastindexof('/')+1); options.mimetype="image/jpeg"; var ft = new filetransfer(); ft.upload(imgbyte, imgurl, win, fail, options); alert("finished calling upload"); } function win(r) { alert("success"); console.log("code = " + r.responsecode); console.log("response = " + r.response); console.log("sent = " + r.bytessent); } function fail(error) { alert("an error has occurred: code = " + error.code); console.log("upload error source " + error.source); console.log("upload error target " + error.target); }
new guidance
log cat error : 04-18 18:30:31.621: e/filetransfer(9459): {"target":"http:\/\/10.1.6.88:8080\/todaysadminads\/resources\/service\/vendor\/vendorregistration","source":"\/9j\/4aaqskzjrgabaqaaaqabaad\/2wbdabalda4mchaodq4seratgcgagbywgdejjr0oojm9pdkzoddasfxoqerxrtc4ug1rv19iz2hnpk1xexbkefxlz2p\/2wbdaresehgvgc8agi9jqjhcy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2p\/waarcahga9qdasiaahebaxeb\/8qahwaaaqubaqebaqeaaaaaaaaaaaecawqfbgcicqol\/8qatraaagedawieawufbaqaaaf9aqidaaqrbrihmuege1fhbyjxfdkbkaeii0kxwrvs0fakm2jyggkkfhcygroljicokso0nty3odk6q0rfrkdisuptvfvwv1hzwmnkzwznaglqc3r1dnd4exqdhiwgh4ijipktljwwl5izmqkjpkwmp6ipqrkztlw2t7i5usldxmxgx8jjytlt1nxw19jz2uhi4 tl5ufo6erx8vp09fb3 pn6\/8qahweaawebaqebaqebaqaaaaaaaaecawqfbgcicqol\/8qatreaagecbaqdbacfbaqaaqj3aaecaxeebsexbhjbuqdhcrmimoeifekrobhbcsmzuvavynlrchyknoel8rcygromjygpkju2nzg5okneruzhselku1rvvldywvpjzgvmz2hpann0dxz3ehl6gooehyahiimkkpoulzaxmjmaoqokpaanqkmqsro0tba3ulm6wspexcbhymnk0tpu1dbx2nna4upk5ebn6onq8vp09fb3 pn6\/9oadambaairaxeapwdrwokt8kcenambusceetiqtisr2p4uvy8untgd8kadg9auy5xj8qtp97ilaaxja goaxv05pdnpgfw7uypg2qckleomokaazzypel4bpahtimjhjuchnnkqeeat\/sgbu9yxgwbcz3dqcthcgqmyych9kglbttufu27gghchnhnac8 gogeqv5ox8umdhukrepauy65joaenxp0p2mdqzkd1 ukcm4pqcgbdzsdtz hfid1yccpwloax\/jxsd \/0o7hfa5pagbmkfew2e4hsjhoepalhb7y lb6cauan 7irgyizzshhjgfptzaog7rz\/jr8wjiix2oavwychoehgafuhbfq yvkwxqk3igtmhmypx8yhqehu0asbz7rj2pc5wqc9ikzga\/ko\/rsk7tji nsgbd5iz2pqx56yqntjl8wddcomzankqgaodx0ptfaadjplatzjrilb2hvlbj2peg5oqttmkkfuc47ggbguy5xcqoycw4p4vikebjczetafuyyf6hnopypwzxg3n8m0agwzbaor3x2pckdklzszzztp0peoudmga3hptikjvsjkhv2ngqxhzchpt6up4bi5px3oax3\/nseucfls49kmhhquaapbah4uyye9hi n0o5oat2hx35xs9ucgk5z22 nehhkdtu9qkadgfvy\/wnba6nr dln2pmdrzqaa5ood7ueakhbh8qu4x1njg5i7ggaja6scpek25jfjxjgosknumyx6ecl5x0j\/ggabj6g9auca4bpvj6yx tkmqb0460akd1g0jnvrgh1pgjhgce9okuhpixqabcc4anhfjniassdnhueueeh\/eigbewm4z pnkmheocd6mfcngt6cgqmjcn\/639aafjpfgeaab1god0okman3\/aj0ao6chjoyaof5umotx pejgor\/kgbf4vagjipmtjjafq4pfu7rnp0oaaopyt9aql9uqat2b4oyoecpwzr\/noo1adgfaj1oapsapmgcgfhqavaki n fl0pucnqrqac9qcax86b3wcypefu\/lntqao9xil474pbnvs\/gokaephfmjka8drxqcm\/d\/hhwk\/aigbeh7uo lioexpr fab26uh llsdz60akokwkgme1kmuahaijh55oxqad6mfhqdsuafltau0aikxfa4ooawikooawkpasga6uuuuagkdrrqadm0nqd6xhvsdo1acchsdj7uvjhtfjzmlpviga79qtapv60doo6uljqm4oaxffhtpagflqafgkb1pp2o\/ogd0xqac9suntrmjobs0agedxzrr va69kaeawt70tfj fabydgj8axvr2xikhj6ualqporsywkmdrigaxsyx7 9ljtmjb9qag89mh60ufq3xqoekmcc8uarl1u43kvtrt8l\/cb96kah4hqatb vainkem4facywkqzhc0zyuceex7ucc0aa78n\/cjpht9kpwobi9kabjjh6uzk9ce2kmn0ppzzqahus\/p3d\/djpqb2xn8kuajome\/lqprj2xg0ajs5zk 9kopumnyppxqtgchh4uajgjnnhpqoe2ptnjk56c445odehbuknrjkuao598e9lniwr7dkat6j8kqczx07djigbwbhpwkwc8\/lqwwekzu9zqbj7f0polbzwmdjnmomuyl4evb9wapjx1so4njz9qav0i1ct2rzwobxntqo46fhvdlu1yctx\/niplksfdynj0ncayngs3q7gt lmjaufb0xjfp6dk80zegfiackcimsk5tiqg5pqd\/zpfkogatbpxv vekcg5r1b3boauoccddnt8vh\/wcqgbeqppaoohgeatadgky45hak8spyzc3qdijafxoooo46ggbrmriplky6ziofwxtyccwyseawrjnltxjhb g5pm4cjflkppp\/n2oad5p3hqjezeybp e9kcw 8cfxnptvofwpaznxarsb6nz wkadjzwcpp0o8xsjiaa6ginbucbwh5yoyrjk4 tab5inrn8qcygc\/okzhimbw2sbwgap u7afwgbvc4 xgumv37qru649qrvxqbg0fegjpqdqa7bnjg\/hr0z1zsacuoz9prqadjhoapypf50zoat8b nj68uvv3o negbbx90j6guphvz6ightke4prx1facdkqjpv8a0pfpmjoaadnsktoebxs49qcpr hagboczjph60uedgfqunxjeoenrryotjh9aaedda6hhenh6hprtsxajvc\/tapqr054oaxtnbo4ppl6de\/0o69oft0oafxb06dvahtjkjofu0ppoccenvqaufuy tjz32n0xsgcjh1oab8vxakcwao0n8s0pbz0\/ck5z3 laacsmq4hq8ilgrkdfpsdqed9cuhjjajxzx1oaume4x6uoy9chh0pgjbzk5ihuu4fiowp0oaukyja59kmgdr fj859b70vzdqd hsgahxg4b6cuhznocppru4gqfyozjjgbqaexxijkjjaob1njjagtx346048eggba2dgkz9ulo57kckp4flsdb 6bqa8zpcu0nhwjhqokcam4b lac9e1kpc0i\/u0vsgayktoam460vrj vacd9p5uta\/ggdaad8 kuuuuaiekthvs0lac0umkwgaooooakmuutabsutfacuypasgaxrrrqadqt14patoaaaexjkj8axfhq0uaa\/pqfwge1h6uagkm8ccki7jr6uvpx8xigab4pm\/hj1ooe3wjaopx7ual27uzpb0ooax dabshooat7uv4unvg\/t0oaxt0xr lnzxngauyhhjoawgyopp89kaeyacnpfljtr nirnbyrjpqathsjpsdzxzqadz0\/kmkge5izqqxiipgecuubnixbpx3oatn 6fyopnrzpzcz4golfadvpxs5hqm0mmhgupb7uajjsbttwtngdqdikom4zzqaflmlayof5umewpxpxsk\/b4kn0nadj6ddrwogo79qttgnhxnukaeyc3apotjokacviyfu9qoo3apffcqfyae\/ftqa4gnts845\/ltcbsqvyp4p0pk
Comments
Post a Comment