jsutton's Recent Forum Activity

  • Is there a way to have construct 3 lower the quality of an imported image?

    (I read where the quality is png 32 and wonder if that can be changed to a jpeg 50 when importing? One can import the image, resize, paste to drawing canvas, and save it as a jpeg 50 but was curious if there is a simpler way?)

  • Well I learned something new today.

    I've used AJAX for 5 years (through C2) and never realized the URL line is a GET line only. Wasn't ever an issue before and never needed the POST. Now that I've figured that out, and CAN send, without issue, base64 to and from the server.

    This one is just out of curiosity and if you don't feel like responding no worries.

    What I do not understand:

    How does one specify where the binary data would end up (the specific cell inside the database_ using "Post binary to URL"?

    Binary to unspecified location (which is what I understand from your previous post).

    What I need to have happen, unfortunately this won't work, but hopefully you understand what I mean.

    (That is to say, there is no way to specify where the AJAX - POST binary to URL results should go.

    My normal way

  • Just to wrap this up.

    To send an image to the server using *.php via AJAX is doable.

    However, your server may limit the url to a certain number of characters (usually 8190 characters, this is to slow Denial Of Service (DOS) attacks against the server per Hostgator.) see 414 error*

    When retrieving data from the server, usually the url is unlimited (no need for them to worry about DOS when sending).

    The suggestion has been made to use a Blob, but the best I understand it, this is only done locally and is of no help when sending data over the internet.

    Using binary might reduce the url by 30%, but on a 5mb file, that is still well over the server threshold of characters and again makes the url too long to be sent.

    The only solution I see it to parse the data, send multiple AJAX post and just append the cell text that holds the picture data.

    Hope this information helps others.

    If anyone can add information to this, or sees an error please let me know. Thank you.

  • So the error I was getting is based on the server httpd file limitrequestline = 8190 and as such I'm unable to send the url of a picture in base64 that's larger than 8kb. Punt and look for a new method.

    (Just in case someone else has the issue. The way I figured this out was to copy the error url into the browser and it gave an error 414. But, at least one path has been thoroughly explored.)

  • After 5 days, this is what I can say for sure.

    When sending the ajax request with a small data set, it works just fine.

    When the file is larger it gets this error:

    rkJggg==' from origin 'https://preview.construct.net' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

    This should be working...this is the only error I can not account for.

  • Ashley

    The buffer is 49k in length, so that's not looking at the url.

    The url is there, it's your blob preview option

    The float64(*) [personally I figured this should be 8, but 8 returns 0 so I used 1 and it returns what looks like the URL data in float64]

    Base64 reads and hold the actual file data, unfortunately the data amount is larger than the actual file.

    ***The only BinaryData.Get* that seems to return a value other than the URL is Base64.***

    (The best I can tell, base64 is also the only "Get" that can be stored in local storage and retrieved when the browser is close and reopened)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ashley

    If we figure this out, I'm volunteering to do a tutorial.

    I've read every post (even one that was mistakenly put in C2 forum) and tried every combination I can conceive.

    Info being sent:

  • What I am trying to understand: Using construct 3, is there a way to upload an image to a server (ajax/php), retrieve that image, and then insert it into a sprite.

    Tagged:

  • Anyone have any ideas?

    I can upload base64 to the server up to around 5kb of data.

    Past that the upload fails.

    My guess is that it has to do with Apache limiting the URL to 8k characters.

    Is there way to compress this or use an alternative to base64? (if so could you point me in the direction of how to do that? I've read all of the forum comments and the manual. I was thinking I could take the base64 and apply float64(8) and unpack it. Unfortunately I couldn't figure out how to unpack it. At this point, I'm going to take a break...)

    As an aside, URLencode would not work either.

  • This works locally, and I'm still trying to figure out what a byte offset is and how the heck it works.

    The code below will not pass to the server without error (works fine on my local pc). Will update as I figure it out...day 2 is in the books lol. Hopefully a few more days (or less) I'll have something to report that works passing into mysql via phpmyadmin. I will say this, the base64 as a png file is to large.

  • Behavior Fade

  • Some folks have gotten it to work by adding

    data:image/png;base64, in front of the base64 string and then loading via URL

    iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==

    construct.net/en/forum/construct-3/how-do-i-8/load-base64-image-sprite-141995

    I've just not been able to get it working.

jsutton's avatar

jsutton

Member since 31 Mar, 2015

Twitter
jsutton has 1 followers

Trophy Case

  • 9-Year Club
  • Forum Contributor Made 100 posts in the forums
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies