Wednesday, 15 June 2011

upload file jquery wordpress -


I want to change the input button uploaded images in front-end in my wordpress theme. I have read that it is possible with fileupload.js and I try unsuccessfully with the code below.

  & lt; Input id = "fileupload" type = "file" name = "files []" data-url = "server / php /" multiple & gt; & Lt; Div id = "progress" & gt; & Lt; Div class = "bar" style = "width: 0%;" & Gt; & Lt; / Div & gt; & Lt; / Div & gt; $ ('# Fileupload') Fileupload ({/ * ... * / progressall: function (e, data) {var progress = parseInt (data loaded / data quote) * 100, 10); $ ('# Progress .bar'). CSS ('width', progress + '%');}});  

And this is a PHP code for file transfer:

  if ($ _FILES) {$ files = $ _FILES ['upload_attachment']; ($ Files ['name'] [$ of]) {$ file = array ('name' = & gt; $ files ['name $] [$ Key],' type '= & gt; $ files [' type '] [$ Key],' tmp_name '= & gt; $ files [' tmp_name '] [$ key],' error '= & gt; files [' error '] [$ key],' size '=> ; $ Files ['size'] [$ of]); $ _FILES = array ("Upload_Attempt" =>; $ file); Forex currency ($ $ $ FILES = file = & gt; $ as array) {$ newupload = wpcads_inert_attachment ($ file, $ post_id); }}}} Wp_redirect ($ permalink); Go out;  

I have to show this kind of input file or is it possible?


No comments:

Post a Comment