• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

Using flash to post an image into a mysql database

Explorer ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

How can I use flash to insert an image into a mysql database?

I have an android app I'm making where someone post a picture and the picture appears in a mysql database.

This is how I'm doing it: I'm making a php page where in the link you put  like this: example.com/example.php?IMAGE= ______ and it puts it in the mysql database. Only what do I put in the ______ part that will make the picture appear in the mysql database? In flash I'm using getURL to go to the url listed above.

How do I make the picture that they take in my app appear in the ______ part of the link and into my mysql database?

TOPICS
ActionScript

Views

3.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jun 11, 2012 Jun 11, 2012

Again, you can just hit edit rather than making 2 posts. People get emails every time you post. You just sprayed me with emails.

If you can upload with flash and your problem is server side related, try the appropriate forum as that has nothing to do with Flash. Perhaps the Dreamweaver forum.

Good luck

Votes

Translate

Translate
LEGEND ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

You should search google for AJAX uploader scripts. Almost all use flash, are free and have source code. Just use prewritten code for that. They come with the PHP also and the code is simple.

It all uses URLLoader or Socket (rare/advanced) to send the data in binary (fast). Then you can save that binary directly to a blob in mysql (unrecommended) or to a file on the server.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

can you give me a tutorial?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

Is there any good reason you want to save such potentially enormous data in a database rather than the filesystem? You can just use mysql to pair the uploaded files with a specific user and keep it simple.

Here's you're run of the mill uploader with a demo included, all the source, etc.

http://code.google.com/p/swfupload/

If you do decide to save it in a database then you literally just have PHP read the binary data and pass it directly through (with a proper image header) and Flash can load it like a regular image. It's literally MySQL Binary -> PHP -> Flash and it just shows up as the file type you designate.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

oh im trying to make it like a public server where everyone can read what the people post so im using mysql for my server

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

That doesn't mean you can't just give the file a unique name, save it in a path and only save the text info required (user id, filename) in the database. Then query the DB for all available images and just read it directly from the filesystem.

What happens if your DB becomes corrupt? You lose all the images? You have far less of a chance of the db running slow or losing all your images just using the filesystem.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

Thank you

i will try it

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

You're welcome and good luck

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

Also I know how to make them take the picture with their android phone i just need that picture to show.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

Ill be back in about ten minutes

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

That library has the code to upload an image via flash. It doesn't need to be uploaded from a webpage.

Easy on machine gunning posts in here, it's not a chat room. Just hit edit on a previous post rather than adding more posts.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

I know how to upload a picture in flash. I just want it to be public so everyone can see it. Can you help me with this?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

Okay. I understand that it isn't smart to upload your image to mysql, but I'd like to give it a try.

If you still don't want me to try, give me a list of the disadvantages.

And what are the advantages of binary and how can I use them?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

LATEST

Again, you can just hit edit rather than making 2 posts. People get emails every time you post. You just sprayed me with emails.

If you can upload with flash and your problem is server side related, try the appropriate forum as that has nothing to do with Flash. Perhaps the Dreamweaver forum.

Good luck

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

I just realized I can't do it. I want the image to be uploaded in flash not on a web page.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

looking for an answer

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

What kind of variable receives the PHP file?,

Usually what is done is to convert the image into a byte array and send


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 11, 2012 Jun 11, 2012

Copy link to clipboard

Copied

can you create a byte array in mysql and have it converted back into flash?

how would i make the array it the link?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines