Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using flash to post an image into a mysql database

Explorer ,
Jun 11, 2012 Jun 11, 2012

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
3.6K
Translate
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

Translate
LEGEND ,
Jun 11, 2012 Jun 11, 2012

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.

Translate
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

can you give me a tutorial?

Translate
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

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.

Translate
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

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

Translate
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

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.

Translate
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

Thank you

i will try it

Translate
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

You're welcome and good luck

Translate
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

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

Translate
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

Ill be back in about ten minutes

Translate
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

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.

Translate
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

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?

Translate
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

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?

Translate
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
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

Translate
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

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

Translate
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

looking for an answer

Translate
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

What kind of variable receives the PHP file?,

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


Translate
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

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

how would i make the array it the link?

Translate
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