NOTE: these macros don't work on a DSi due to the browser not supporting CORS. For a solution that DOES work on a DSi, check out Robdeprop's blog.
Before trying to upload a pfp, it might be a good idea to check whether your device is compatible. If you click the button below and the message "Hello from DSi World!" pops up onto your screen, you should be good to go!
[a=#"onclick="event.preventDefault();try{alert('Starting test...');function createCORSRequest(method,url){var xhr=new XMLHttpRequest();if('withCredentials'in xhr){xhr.open(method,url,true);}else if(typeof XDomainRequest!='undefined'){xhr=new XDomainRequest();xhr.open(method,url);}else{xhr=null;}return xhr;}var a=createCORSRequest('GET','https://dsi-world.herokuapp.com/base64');a.onreadystatechange=function(){if(a.readyState==4){alert(a.responseText);}};a.send();}catch(e){alert(e);}return false;]Preliminary test[/a]Basic CORS test
NOTE: The below macros will not work if you are on 3DS Paint. You must be on DSi Paint for these macros to work.
Since you've gone through the trouble and found this profile, I might as well outline a step-by-step guide on how to use these buttons.
STEP 1: Click on the button below. For subsequent uploads, you only need to refresh the page. (You can scribble some funny things in there like I do, if you like. Even if you save, it won't matter, since what you draw will be overwritten.)
NOTE: this step is automatically taken care of in the experimental v2 uploaders.
This step is important in order to ensure that previous paintings are not overwritten by your new upload. If you wish to overwrite your most recent painting, then skip this step and use the v1 uploaders.
STEP 2: Click a button below to upload your profile picture. Use method 1 if you have the picture on your computer and you want to upload it. Use either method 2 to upload an image from a URL. If one doesn't work, try the other one. Do NOT use method 3 unless you know what you're doing. The process might take a while. Give it a moment. If lots of garbage characters appear on your screen, then it worked.
[a=#"onclick="event.preventDefault();try{if(typeof jQuery == 'undefined'){var jj=document.createElement('script');jj.src='https://code.jquery.com/jquery-3.5.0.min.js';document.getElementsByTagName('head').item(0).appendChild(jj);alert('Successfully included jQuery.');}var a=document.getElementById('blog_body');var b=document.createElement('form');var c=document.createElement('input');c.type='file';c.name='image';c.accept='image/*';b.appendChild(c);var d=document.createElement('input');d.type='submit';d.value='Upload to DSi Gallery';b.onsubmit=function(){alert('Upload starting...');try{var data=new FormData(b);var opts={url:'https://dsi-world.herokuapp.com/base64',data:data,cache:false,contentType:false,processData:false,method:'POST',type:'POST',error:function(err){alert('DSi World didn\'t give a valid response. Try using a smaller file or refreshing the page.');},success:function(data){alert(data);var SaveObj=new XMLHttpRequest();SaveObj.open('POST','http://dsipaint.com/paint/includes/ajax_dsipaint_save.php',true);SaveObj.setRequestHeader('Content-type','application/x-www-form-urlencoded');SaveObj.onreadystatechange=function(){if(SaveObj.readyState==4){alert(SaveObj.responseText);}};SaveObj.send('data='+data);}};if(data.fake){opts.xhr=function(){var xhr=jQuery.ajaxSettings.xhr();xhr.send=xhr.sendAsBinary;return xhr;};opts.contentType='multipart/form-data; boundary='+data.boundary;opts.data=data.toString();}jQuery.ajax(opts);}catch(e){alert(e);}return false;};b.appendChild(d);a.insertBefore(b,this.nextSibling.nextSibling);a.insertBefore(document.createElement('p'),b);}catch(e){alert(e);}return false;]Method 1[/a](Profile picture
upload)
[a=#"onclick="event.preventDefault();try{if(typeof jQuery == 'undefined'){var jj=document.createElement('script');jj.src='https://code.jquery.com/jquery-3.5.0.min.js';document.getElementsByTagName('head').item(0).appendChild(jj);alert('Successfully included jQuery.');}var a=document.getElementById('blog_body');var b=document.createElement('form');var c=document.createElement('input');c.type='file';c.name='image';c.accept='image/*';b.appendChild(c);var d=document.createElement('input');d.type='submit';d.value='Upload to DSi Gallery';b.onsubmit=function(){alert('Upload starting...');try{var data=new FormData(b);var opts={url:'https://dsi-world.herokuapp.com/base64',data:data,cache:false,contentType:false,processData:false,method:'POST',type:'POST',error:function(err){alert('DSi World didn\'t give a valid response. Try using a smaller file or refreshing the page.');},success:function(data){alert(data);var poke=new XMLHttpRequest(),SaveObj=new XMLHttpRequest();poke.open('GET','http://dsipaint.com/paint/dsipaint.php',true);poke.onreadystatechange=function(){if(poke.readyState==4){alert(poke.responseText);SaveObj.open('POST','http://dsipaint.com/paint/includes/ajax_dsipaint_save.php',true);SaveObj.setRequestHeader('Content-type','application/x-www-form-urlencoded');SaveObj.onreadystatechange=function(){if(SaveObj.readyState==4){alert(SaveObj.responseText);}};SaveObj.send('data='+data);}};poke.send();}};if(data.fake){opts.xhr=function(){var xhr=jQuery.ajaxSettings.xhr();xhr.send=xhr.sendAsBinary;return xhr;};opts.contentType='multipart/form-data; boundary='+data.boundary;opts.data=data.toString();}jQuery.ajax(opts);}catch(e){alert(e);}return false;};b.appendChild(d);a.insertBefore(b,this.nextSibling.nextSibling);a.insertBefore(document.createElement('p'),b);}catch(e){alert(e);}return false;]Method 1 v2[/a](Experimental)
[a=#"onclick="event.preventDefault();try{var a=document.getElementById('blog_body');var b=document.createElement('form');var c=document.createElement('input');c.name='url';c.type='url';c.placeholder='Type an image URL here';b.appendChild(c);var d=document.createElement('input');d.type='submit';d.value='Upload to DSi Gallery';b.onsubmit=function(e){try{e.preventDefault();var x=new XMLHttpRequest();x.open('POST','https://dsi-world.herokuapp.com/base64url?url='+encodeURI(c.value),true);x.setRequestHeader('Content-type','application/x-www-form-urlencoded');x.onreadystatechange=function(){try{if(x.readyState==4){var data=x.responseText;alert(data);var SaveObj=new XMLHttpRequest();SaveObj.open('POST','http://dsipaint.com/paint/includes/ajax_dsipaint_save.php',true);SaveObj.setRequestHeader('Content-type','application/x-www-form-urlencoded');SaveObj.onreadystatechange=function(){if(SaveObj.readyState==4){alert(SaveObj.responseText);}};SaveObj.send('data='+data);}}catch(e){alert(e);}};x.send();alert('Image sent');}catch(e){alert(e);}return false;};b.appendChild(d);a.insertBefore(b,this.nextSibling.nextSibling);a.insertBefore(document.createElement('p'),b);}catch(e){alert(e);}return false;]Method 2 var. A[/a](Profile picture
upload via URL;
vanilla JS)
[a=#"onclick="event.preventDefault();try{if(typeof jQuery == 'undefined'){var jj=document.createElement('script');jj.src='https://code.jquery.com/jquery-3.5.0.min.js';document.getElementsByTagName('head').item(0).appendChild(jj);alert('Successfully included jQuery.');}var a=document.getElementById('blog_body');var b=document.createElement('form');var c=document.createElement('input');c.name='url';c.type='url';c.placeholder='Type an image URL here';b.appendChild(c);var d=document.createElement('input');d.type='submit';d.value='Upload to DSi Gallery';b.onsubmit=function(e){try{e.preventDefault();alert('Attempting to upload '+c.value);window.jQuery.post('https://dsi-world.herokuapp.com/base64url',{'url':encodeURI(c.value)},function(data){alert(data);var SaveObj=new XMLHttpRequest();SaveObj.open('POST','http://dsipaint.com/paint/includes/ajax_dsipaint_save.php',true);SaveObj.setRequestHeader('Content-type','application/x-www-form-urlencoded');SaveObj.onreadystatechange=function(){if(SaveObj.readyState==4){alert(SaveObj.responseText);}};SaveObj.send('data='+data);}).fail(function(err){alert('DSi World didn\'t give a valid response. Try using a smaller file or refreshing the page.');});}catch(e){alert(e);}return false;};b.appendChild(d);a.insertBefore(b,this.nextSibling.nextSibling);a.insertBefore(document.createElement('p'),b);}catch(e){alert(e);}return false;]Method 2 var. B[/a](Profile picture
upload via URL;
jQuery)
[a=#"onclick="event.preventDefault();try{var a=document.getElementById('blog_body');var b=document.createElement('form');var c=document.createElement('textarea');c.className='form_textarea';b.appendChild(c);b.appendChild(document.createElement('br'));var d=document.createElement('input');d.type='submit';d.value='Upload to DSi Gallery';b.onsubmit=function(e){try{var SaveObj=new XMLHttpRequest();SaveObj.open('POST','http://dsipaint.com/dsipaint/includes/ajax_dsipaint_save.php',true);SaveObj.setRequestHeader('Content-type','application/x-www-form-urlencoded');SaveObj.onreadystatechange=function(){if(SaveObj.readyState==4){alert(SaveObj.responseText);}};SaveObj.send('data='+c.value);}catch(e){alert(e);}return false;};b.appendChild(d);a.insertBefore(b,this.nextSibling.nextSibling);a.insertBefore(document.createElement('p'),b);}catch(e){alert(e);}return false;]Method 3[/a](Profile picture
upload via Base64)
STEP 3: Verify it worked by visiting this webpage. As of a recent update, it may take a couple of minutes before your painting actually appears in your DSiPaint Gallery. Give it a moment. If it doesn't show up after a while, try again.