Topic: Take a picture from the webcam and save it into the database...

Hi everyone,


I'm trying to create an application to take pictures from the users' webcam and save them into the database.

This is my actionscript code :

import flash.display.BitmapData;
localCamera = Camera.get();
myCam.attachVideo(localCamera);

var bitmap = new flash.display.BitmapData(320, 240, true, 0x00000000);
this.createEmptyMovieClip("pic", 2);
pic.attachBitmap(bitmap, 20, "auto", true);
btn.onRelease = function() {
    lv = new LoadVars();
    lv.tab = new Array();
    for (i=0; i<240; i++) {
        for (j=0; j<320; j++) {
            lv.tab.push(bitmap.getPixel(j, i));
        }
    }
    lv.send("validate_upload_flash", "_blank", "POST");
};


And here comes my issue : in PHP, I'd use a imagesetpixel method. But in RoR, I just don't know what to do ! sad

Any help ?

Re: Take a picture from the webcam and save it into the database...

I'm not sure how this works but if you're able to send up a file using your flash app, you should look into attachment_fu or paperclip plugin for saving the images onto the server.

Re: Take a picture from the webcam and save it into the database...

Thanks for the tip ! I'll check it out...