Find Jobs
Hire Freelancers

HTML5 XHR Image Uploader - Chrome Extension -- 2

$10-30 USD

Completed
Posted over 9 years ago

$10-30 USD

Paid on delivery
Hi, I currently have a Chrome Extension which you can download here. [login to view URL] The extension allows the user to take screen captures of any website and then upload them to my website. However, due to updating my script, instead of using a flash based uploader - it now uses HTML5. Any attempt to upload an image via the extension would result in uploading a small brown box. I asked the developer of the script why, and this is what he said..... My Message: -------------------- I have modified my Google Chrome extension to work with V3 as this uses POST, however when I upload the file, I'm still getting the small brown box?? Can you spot anything wrong with this piece of code?? [Code] function uploadImage(website, callback) { try { if (website == "ultraimg") { ajaxObj = $.ajax({ url: "[login to view URL]", type: "POST", timeout: 45000, data:{key:"3374fa58c672fcaad8dab979f7687397", source: encodeURIComponent([login to view URL]().replace(/^data:image\/(png|jpg);base64,/, ""))}, dataType: "json", success: function(data) { if(data.status_code == 200) { var imageURL = data.image.display_url; var htmlURL = '<img src="' + data.image.display_url + '" border="0" />'; var BBCodeURL = "[IMG]" + data.image.display_url + "[/IMG]"; callback({imageURL:imageURL, htmlURL:htmlURL, BBCodeURL:BBCodeURL}); [login to view URL](imageURL); return; } else { callback({error:"Error: " + data.status_code + " - " + data.status_txt}); } } }); } } catch (e) { callback({error:"Error: " + e + ". Please try later or try another upload site!"}); } } [/code] A similar code used to work with Version 2 of Chevereto, but since V3, I've always received the brown box? :S However other programs such as ShareX works perfectly fine :S The API response code for the direct link was [login to view URL] As far as I can tell, I'm not using the GET method here? So why the brown box still ? His Response: ---------------------- It won't work because you are sending the data using $.ajax and converting the base64 string. PHP base64 string is very sensitive and if the string has the slightest issue it won't work. If you notice in Chevereto uploader I use the direct HTML 5 XHR to upload the files because every time I used the base64 implementation from javascript it didn't work. So I ended up emulating a html file form. ////// I presume his last sentence was referring to the actual website script. So anyway, as you can see, at the moment MY code doesn't work... However, it might work if it's converted to use HTML5 XHR ?? I'm not entirely sure if that's possible or if I'm asking the correct question. Feel free to download my extension that I linked to above and try to edit the file called... '[login to view URL]' - within the 'js' folder. If you are able to get the screen captured images uploaded and working 100%, and are also able to get the correct API responses then I will be very happy to work with you. Thank you for reading my project.
Project ID: 6369847

About the project

1 proposal
Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Nie złożono jeszcze oferty.
$30 USD in 0 day
4.5 (33 reviews)
5.1
5.1

About the client

Flag of UNITED KINGDOM
United Kingdom
5.0
3
Member since Jul 6, 2002

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.