vostro Posted December 3, 2011 Report Share Posted December 3, 2011 (edited) Labvakar visiem, kā pareizi nododas bilde. HTML <input type="file" id="filename" class="filename" /> JS var filename = $("#filename").val(); $.ajax({ type: 'POST', url: '/news/attachPost', data: { filename : filename}, dataType: "json", success: function(msg){ if(msg.error){ $('#errorAttach').fadeIn(1000, function (){ $('#errorAttach').html(msg.error); }); return; } alert(msg.image); } }); POST pieņem viss kārtībā PHP $image = $_POST[''filename"]; Ir iespēja dabūt tā? $image = $_FILES["filename"]; Edited December 3, 2011 by vostro Quote Link to comment Share on other sites More sharing options...
daGrevis Posted December 3, 2011 Report Share Posted December 3, 2011 Kāpēc? Quote Link to comment Share on other sites More sharing options...
vostro Posted December 3, 2011 Author Report Share Posted December 3, 2011 Vēlos pēc tam failu (bildi) iemest serverī. Ja nodotu POST tad tikai dabūju iemest nosaukumu datu bāze, a mapē uploads nav pašas bildes. Vai es kaut ko ne to daru? Quote Link to comment Share on other sites More sharing options...
Mr.Key Posted December 3, 2011 Report Share Posted December 3, 2011 http://stackoverflow.com/questions/551627/jquery-receiving-the-files-array-using-post Quote Link to comment Share on other sites More sharing options...
briedis Posted December 3, 2011 Report Share Posted December 3, 2011 Ar AJAX nevar augšupielādēt datnes. Quote Link to comment Share on other sites More sharing options...
vostro Posted December 3, 2011 Author Report Share Posted December 3, 2011 Mr.Key paldies Briedis paldies Paņemu uploadify pluginu! Quote Link to comment Share on other sites More sharing options...
daGrevis Posted December 3, 2011 Report Share Posted December 3, 2011 Iesaku Plupload (piekriitu, nosaukums sux!). Quote Link to comment Share on other sites More sharing options...
vostro Posted December 3, 2011 Author Report Share Posted December 3, 2011 daGrevis ok! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.