A Form With Jpg Upload Button
can anyone help me figure out how to do a basic backend in flash mx we just want a form with 3 or 4 text input fields, with an upload jpg button as well so the user can upload jpgs and some related text from his/her hard drive to our server and we can then pull it from there into our swf somehow
I'm wondering if MySQL is even necessary. maybe we can do a basic form with a jpg upload button just with XML and actionscript or PHP and actionscript
any counsel is much appreciated...
FlashKit > Flash Help > Flash MX
Posted on: 11-11-2004, 09:45 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Upload Form
hey!
Looking for a way of uploading (or at least sending by mail)files from a flash form, guess using php... any idea
Cheers guys!!
Upload Form..
I have been looking for an image uploading form, or a general uploaading form, that I can work with in flash.
I need to be able to:
Limit the file size
Make sure it isn't over certain dimensions..ie 20x20, or w/e.
Be able to rename the file after upload.
How would I achieve this? Thanks guys
Upload Form
Hey guys,
First, thanks alot for any future help
Second, I promise I will get to the flash part
here is the code I am using:
image.html
Code:
<form enctype="multipart/form-data" action="image.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
Now, my main problem with this is I would like to have the php and the html on the same page(explain later)
image.php
PHP Code:
<?php
$uploaddir = $_SERVER['DOCUMENT_ROOT'].'/client/images/';
$uploadfile = $uploaddir . $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:
";
print_r($_FILES);
} else {
print "Possible file upload attack! Here's some debugging info:
";
print_r($_FILES);
}
print "</pre>";
?>
Now this is cool and all, and gets me the results I like, it uploads and does all that..now my biggest problem...
The thing is, I am loading this from a user's profile. In flash, whenever they login, they click a button that brings up a popup(.html, or .php) for them to upload a file. I want to be able to get their username from flash, then rename the uploaded file to that username.
I know I can send vars to php from flash and all that, but I don't know how to open a new window and give those var's to php. Usually I would use Loadvariables to give the var's, but now to open the file I am using:
Code:
window.open('http://dsistudios.com/client/image.php','Upload_Images','width=226,height=63,resizable=no,scrollbars=no,toolbar=n o,top='+((screen.availHeight/2)-(63/2))+',left='+((screen.availWidth/2)-(226/2))+'');void(0);
So how could I pass the variables to flash, then(This is more of a php question) rename the file to that variable?
Thanks guys,
Chase
Upload Form..
Hey guys,
I'm having a problem with an upload form..
Here is what I need to know how to do..
First, upload from flash itself, so be able to bring up the file browser and everything else. I don't know javascript, and people have suggested that, so if I do need to use javascript, could you explain to me really well how I can do this? (Thanks)
Also, after uploaded, I want to move it to /images, and rename it to a username that I will already have, so afterwards rename it $user.".jpg" or however I would do that..
Thanks alot guys, this means a bunch
Also, limiting file size and dimensions would be great.
Upload File Form?
is there anyway a flash site can have a "file" field so the user can browse for a file to upload? like a normal html one? if anyone knows of a way this can be done id really apprecialte it. thanks.
Form And Upload A Picture
Hi,
I've a couple of questions, I like to use php for my forms in html, does anyone has a good tutorial for flash mx 2004?
Also, and this is my main question: I would like visitors to upload their picture, so I receive it together with the form mail.
Thank you
Steven
Upload Form Problem
k guys, thanks for readin this but i am going to get straight to the point:
-The problem lies somewhere within either the 3rd frame of the _root or in the php code that lies in uploadhandler.php
-there is no problem with anyother part of the fla, the cookie verification works perfectly
When i try to upload something using this form, with the load bar i created it seems as though the file gets nearly all the way uploaded but then fails to complete the uploading, i have included the file if anyone would be so gracious to look at it, thanks!
Flash 8 Upload Form
Does anyone know the file size limit for the flash 8 upload form, I created a form for the different types of movies, but it seems that the upload fails if the file size is greater than 2MB
Form With File Upload
http://www.yourpartsyourway.com/?campaign=google#quote
pretty much something exactly like this with all the fields and i really need to know how they can browse their computer and upload/send me their files. any help would be amazing thanks
Flash Form Upload Help
ive found a few "how to" pages on this but nothing very intuitive.
im having trouble adding a for to a flash file wiht a browse for file button/dialog.
i need to send the variables to an asp page..and would like to stay awya form using an html form...
i found this but im not sure if it applies:
http://livedocs.macromedia.com/centr...e=00000275.htm
and this file was a bit of a help...
but i dont see it sending the data to asp...php or cfm.
http://www.pixelficker.com/flash-8-file-upload-beta/
and i found this too...
but i dont use CF...and id like to keep it that way.
http://www.asfusion.com/blog/example...on-flash-forms
if any one knows of a tutorial or can show me how to do this
please lend a hand...thanks !
crobar
PHP Flash Upload Form?
Okay so I know how to create a mail form and an upload file button in flash that works with php. My question is can I combine the two? I want to create a form that will allow a user to fill in necessary fields and upload a file to my server if necessary. After they hit send the file will then upload t the server and the data from the form then is emailed to me.
Is this possible?
Upload Form In Flash
I know I've seen this before and was wondering if someone could point me in the right direction. I want clients to be able to upload files to my server. Thanks in advance.
MX Upload Image Form?
Hi,
Is there a way to create a form in Flash MX that can allow the user to upload or email an attached image?
Thanks in advance,
shrek2003
Upload To Web Folder Using Flash Form
I downloaded and example from:
http://www.impulsedigital.com/idio/idio-v1/
Unable to get it to work on my website - I need to configure it properly, but I don't know if I need to change the asp pages or something in the Flash file itself. Any help would be appreciated.
Upload File Form + Flash
Is it possible?
Anyone done it?
please tell me!!!
I've done it with html/asp but this is the first time i've tried to do it with flash.
Cheers,
Ben
Form With Multipule Image Upload, I Need Some Help.
Afternoon guys,
I have already made some post's last week regarding the issue that i am having.
I am working on an admin area for a letting agency website.
The main problem is with the image's for each "let" that is available.
Each "let" has a limit of 5 images that can be attached to it, front house,bedroom1, bathroom and so on...
Then plan was to use one database for everything, were as before i had a seperate database for images and a seperate database for the lettings. It worked but i knew that i had to make it better(perfect).
So here is the deal.
The user/client will add a new listing.
city,
address,
No. of rooms etc
Now when it comes to the images for the listing.
The user/client clicks on a button to load the upload window and the file is uploaded and imgUrl is sent back to flash.
Thats as far as i have got without running into problems.
Because the image date/info is going to be more than one in most cases i need to find a way to tie the diffrent images together so that they can be stored along side the letting data.
At present i have .::.front house|front.jpg.::.lounge|lounge.jpg.::. and so on... and this would be stored as letImages
Then through some AS trickery was able to brake that down to what i needed.
i have yet to try and add data to letImages as current data was added on the fly via phpMyAdmin.
Essentially it is a Form with image upload facilty but more importantly the option to add more then one image to the listing.
I hope i havn't dribbled on to much and that someone can make sense of this.
thanks
Paul
I am hoping that someone can suggest a better way of doing this.
Mail Form With Image Upload
Hi,
I have a flash mail form which I use on my sites which submits to a php form and then get's sent to an email address I set.
I want to be able to use the mail form I have but add in the option of uploading an image which then along with the deatils get's sent to an email address.
Can you help??????????????????
Cheers
Flash Form - File Upload
Hi.
Ok. I am building a from so that users can send contact info to our email in box. I am using a flash php combo to send the var's to our email in box using post..this I have working. What I need help with is UPLOADING FILES.
I would like to have the user click a button that opens a dialog box, where they can choose a file of any type and have it uploaded to our server. Then I would like to have a link in the email created by the php for us to download the file.
This email will contain all the contact info entered and other notes typed by user with links to all the files that they uploaded
Does anyone know how to go about this. I am still not sure if flash can do this feature. Any would be greatly appreciated as I must get this application working soon. If you know where I can see a working sample or online tutorial or something along those lines, Thanks Mike.
Form With Upload File ->to E-mail HOW TO
Hi
perhaps you can help me out here since i got to a dead end!
I am making a form with a upload file feature, already set up the form to come trough an e-mail account ang got the form to select the file to upload
however when it send no file comes in the email
Any suggestions how to do it or what script i need to implement or something
if you saw a tutorial or something would be great since i dunno what else to do know
Thanks in advance
dpidesigner
Form With Multipule Image Upload, I Need Some Help.
Afternoon guys,
I have already made some post's last week regarding the issue that i am having.
I am working on an admin area for a letting agency website.
The main problem is with the image's for each "let" that is available.
Each "let" has a limit of 5 images that can be attached to it, front house,bedroom1, bathroom and so on...
Then plan was to use one database for everything, were as before i had a seperate database for images and a seperate database for the lettings. It worked but i knew that i had to make it better(perfect).
So here is the deal.
The user/client will add a new listing.
city,
address,
No. of rooms etc
Now when it comes to the images for the listing.
The user/client clicks on a button to load the upload window and the file is uploaded and imgUrl is sent back to flash.
Thats as far as i have got without running into problems.
Because the image date/info is going to be more than one in most cases i need to find a way to tie the diffrent images together so that they can be stored along side the letting data.
At present i have .::.front house|front.jpg.::.lounge|lounge.jpg.::. and so on... and this would be stored as letImages
Then through some AS trickery was able to brake that down to what i needed.
i have yet to try and add data to letImages as current data was added on the fly via phpMyAdmin.
Essentially it is a Form with image upload facilty but more importantly the option to add more then one image to the listing.
I hope i havn't dribbled on to much and that someone can make sense of this.
thanks
Paul
I am hoping that someone can suggest a better way of doing this.
File Upload In Flash Form
Hi!!!
Im developing a flash form for a website, and i also need that after the viewers fill the form, they could also upload 2 photos. These 2 photos can't be bigger that 200k each... does anyone knows the AS to do this?? Can i do this in a flash form, or just in a html form?
I dont have any clue on this, so... any help would be great!!!!
thanks in advance!
cheers
Upload Image With Form Data Too
so the problem im having is using fileReference.
i already have a form set up in asp to upload images and a discription.
now i want to move the form into flash to keep the whole app together rather than a pop up html page asking you to browse your file and upload it.
ive found a few examples but dont understand them...or how i can send the rest of the form data that goes with my upload.
i have 3 values that need to come from the form
directoryName=""
imageText=""
then file= browsed file
so far i found somthing like this in the action script help files:
Code:
import flash.net.FileReference;
var allTypes:Array = new Array();
var imageTypes:Object = new Object();
imageTypes.description = "Images (*.jpg, *.jpeg)";
imageTypes.extension = "*.jpg; *.jpeg;"
allTypes.push(imageTypes);
var listener:Object = new Object();
listener.onSelect = function(file:FileReference):Void {
trace("onSelect: " + file.name);
if(!file.upload("http://www.website.com/upload.asp")) {
trace("Upload dialog failed to open.");
}
}
listener.onCancel = function(file:FileReference):Void {
trace("onCancel");
}
listener.onOpen = function(file:FileReference):Void {
trace("onOpen: " + file.name);
}
listener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
trace("onProgress with bytesLoaded: " + bytesLoaded + " bytesTotal: " + bytesTotal);
}
listener.onComplete = function(file:FileReference):Void {
trace("onComplete: " + file.name);
}
listener.onHTTPError = function(file:FileReference):Void {
trace("onHTTPError: " + file.name);
}
listener.onIOError = function(file:FileReference):Void {
trace("onIOError: " + file.name);
}
listener.onSecurityError = function(file:FileReference, errorString:String):Void {
trace("onSecurityError: " + file.name + " errorString: " + errorString);
}
but.onPress = function(){
var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);
fileRef.browse(allTypes);
}
but dont see how i can add in my extra 2 values to this
when i trace file.name in the fileReference all i get is a name not a full path...
any one know how i could add the extra for data in to this....aside from
http://www.website.com/upload.asp?directoryName="value"&imageText="value"
witch i havent tried yet but if its the only way ill have to go with it...
thanks in advance for any help
E-Mail Form With File Upload
Hi,
I am trying to take this form here
http://www.south-beachmodels.com/popup_form.php
and convert it to a flash form. This flash is a pretty basic Html form, it takes multiple fields and 4 file uploads and sends them to a php file which sends it to an e-mail address.
I have viewed the tutorials on uploading a file and flash and the tutorial on the e-mail form in flash but I am having trouble combining them.
Go here http://www.south-beachmodels.com to see where I am trying to place the form in flash.
I am unsure of which variable is passed the the php file in the flash file upload tutorial.
Scott
A File Upload Form In Flash
Hi
umm, well, I was just sitting & the idea struck.
Can a file upload form be made in Flash? Ok, simple forms have been made in Flash before but can the fuctionality of the <input type=file> be incorporated in a flash movie through some scripting or is there a component available?
Any ideas & comments are welcome(though there are restrictions on comments stating that I am selected for the Looney Tunes Show)
Solutions are more than welcome.
AS2 - Multi File Upload Form Help
hi guys,
I have been working on the multi upload form over the past couple of days.
It's a variation of stuff i have found about the net.
The form has to buttons. One for single file uploads and one for multi file uploads.
The single file upload button works as it is supposed to but the multi file upload but although does upload all selected files it does not fire off any events.
I think i might have over looked something. Could someone have a look at the code below and see if they spot anything obviuos.
Thanks
ActionScript Code:
import flash.net.FileReference;
import flash.net.FileReferenceList;
var listenerSingle:Object = new Object();
var listenerMulti:Object = new Object();
var imageFileSingle:FileReference = new FileReference();
var imageFileMulti:FileReferenceList = new FileReferenceList();
imageFileMulti.addListener(listenerMulti);
imageFileSingle.addListener(listenerSingle);
//
var count:Number = 0;
var list:Array = new Array();
//
import works.PathManager;
import works.ButtonCellRender;
var folder:String = PathManager.secureVar();
var folderID:String = folder.slice(5);
//----------------------------------------------------------
files_dg.addColumn("Thumb");
files_dg.addColumn("Name");
files_dg.addColumn("Size");
files_dg.addColumn("Status");
files_dg.addColumn("Remove");
files_dg.getColumnAt(0).resizable = false;
files_dg.getColumnAt(1).resizable = false;
files_dg.getColumnAt(2).resizable = false;
files_dg.getColumnAt(3).resizable = false;
files_dg.getColumnAt(4).resizable = false;
files_dg.getColumnAt(0).width = 102;
files_dg.getColumnAt(1).width = 180;
files_dg.getColumnAt(2).width = 60;
files_dg.getColumnAt(3).width = 120;
files_dg.getColumnAt(4).width = 210;
var col:Object;
var col2:Object;
col = files_dg.getColumnAt(4);
col.cellRenderer = "ButtonCellRenderer";
col2 = files_dg.getColumnAt(0);
col2.cellRenderer = "imageCellRender";
//----------------------------------------------------------
//------------------------------------------------------------------------
listenerSingle.onSelect = function(selectedFile:FileReference):Void {
files_dg.addItem({Name:selectedFile.name, Size:Math.round(selectedFile.size / 1000) + " kb", Status:"Uploading", Remove:"Remove"});
selectedFile.upload(PathManager.PATH_2_PHP + "f8upper.php?rnd=" + folderID);
butSingle.enabled = false;
butSingle._alpha = 40;
};
listenerSingle.onOpen = function(selectedFile:FileReference):Void {
//
};
listenerSingle.onComplete = function(selectedFile:FileReference):Void {
files_dg.editField(count,"Status","Upload complete");
files_dg.editField(count,"Thumb",PathManager.URL_PATH + "temp/" + folderID + "/" + selectedFile.name + PathManager.secureVar());
butSingle.enabled = true;
butSingle._alpha = 100;
files_dg.rowHeight = 102;
count++;
};
butSingle.onRelease = function() {
imageFileSingle.browse([{description:"Image", extension:"*.jpg;"}]);
};
butMulti.onRelease = function() {
imageFileMulti.browse([{description:"Image", extension:"*.jpg;"}]);
};
listenerSingle.onHTTPError = function(file:FileReference, error:Number) {
statusArea.text = "HTTP error: with " + file.name + ":error #" + error;
};
listenerSingle.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
trace("here")
var percentDone = Math.round((bytesLoaded / bytesTotal) * 100);
files_dg.editField(count,"Status","Uploading: " + percentDone + "%");
};
//------------------------------------------------------------------------
listenerMulti.onSelect = function(file:FileReferenceList) {
butMulti.enabled = false;
butMulti._alpha = 40;
list = file.fileList;
for (var i:Number = 0; i < list.length; i++) {
trace("// onSelect:" + list[i].name);
files_dg.addItem({Name:list[i].name, Size:Math.round(list[i].size / 1000) + " kb", Status:"Uploading", Remove:"Remove"});
list[i].upload(PathManager.PATH_2_PHP + "f8upper.php?rnd=" + folderID);
}
};
listenerMulti.onOpen = function(file:FileReference):Void {
trace("multi opened")
//
};
listenerMulti.onHTTPError = function(file:FileReference, error:Number) {
trace("HTTP error: with " + file.name + ":error #" + error)
};
listenerMulti.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
trace("// onProgress with bytesLoaded: " + bytesLoaded + " bytesTotal: " + bytesTotal);
for (var i:Number = 0; i < list.length; i++) {
if (list[i].name == file.name) {
var percentDone = Math.round((bytesLoaded / bytesTotal) * 100);
files_dg.editField(count,"Status","uploading: " + percentDone + "%");
}
}
};
listenerMulti.onComplete = function(file:FileReference) {
trace("onComplete: " + file.name);
for (var i:Number = 0; i < list.length; i++) {
if (list[i].name == file.name) {
files_dg.editField(count,"Status","Upload complete");
files_dg.editField(count,"Thumb",PathManager.URL_PATH + "temp/" + folderID + "/" + file.name + PathManager.secureVar());
count++;
}
}
butMulti.enabled = true;
butMulti._alpha = 100;
files_dg.rowHeight = 102;
};
//------------------------------------------------------------------------
finBut.onRelease = function() {
if (validateUpload()) {
_parent.imgUp.tInfo.htmlText = "( <font color='#cc0000'>" + imgCount + "</font> ) Images attached.";
_parent.upper._visible = false;
} else {
trace("Make sure all uploads are complete");
}
};
function validateUpload():Boolean {
for (i in files_dg.dataProvider) {
if (files_dg.dataProvider[i].Status != "Upload complete") {
break;
return false;
} else {
imgCount = i;
return true;
}
}
}
function removeME(who) {
files_dg.removeItemAt(who);
}
bg.useHandCursor = false;
stop();
Problem Using Flash Upload Form
Ok, this is my prob :
My project works great, but when I go to the upload menu, my buttons just don't work anymore. Im using labels on my main scene and AS for the buttons to go to those labels. So the problem must be on the AS for the UPLOAD FORM.
You can check the site here : http://www.daquitters.com/paulsite/index.html
you most do a login first... use this :
User name : newuser
Password : 123456
and this is the AS for the UPLOAD FORM in my main scene :
stop();
System.security.allowDomain("http://daquitters.com/");
import flash.net.FileReference;
var listener:Object = new Object();
listener.onSelect = function(selectedFile:FileReference):Void {
statusArea.text = details.text = ""
statusArea.text += "Attempting to upload : " + selectedFile.name + "
";
selectedFile.upload("upload.php");
};
listener.onOpen = function(selectedFile:FileReference):Void {
statusArea.text += "Uploading... Please wait " + "
";
};
listener.onHTTPError = function(file:FileReference, httpError:Number):Void {
imagePane.contentPath = "error";
imagePane.content.errorMSG.text = "HTTPError number: "+httpError +"
File: "+ file.name;
}
listener.onIOError = function(file:FileReference):Void {
imagePane.contentPath = "error";
imagePane.content.errorMSG.text = "IOError: "+ file.name;
}
listener.onSecurityError = function(file:FileReference, errorString:String):Void {
imagePane.contentPath = "error";
imagePane.content.errorMSG.text = "SecurityError: "+SecurityError+"
File: "+ file.name;
}
listener.onComplete = function(selectedFile:FileReference):Void {
statusArea.text += "Upload finished." + " Thanks for your patience
";
details.text = ""
for(i in selectedFile) details.text +="<b>"+i+":</b> "+selectedFile[i]+"
"
downloadImage(selectedFile.name);
};
var imageFile:FileReference = new FileReference();
imageFile.addListener(listener);
uploadBtn.onPress = uploadImage;
imagePane.addEventListener("complete", imageDownloaded);
function uploadImage(event:Object):Void {
imageFile.browse([{description: "Image Files", extension: "*.sit;*.zip;*.etx;*.hqx;*.bin;*.sea;*.txt;*.mp3*.mp4;*.sd2;*.aiff;*.wav"}]);
}
function imageDownloaded(event:Object):Void {
if(event.total == -1) {
imagePane.contentPath = "error";
}
}
Thanks!!
Actionscript/flash + Php Upload Form
Ok, i have an actionscript upload form partial which currently uploads 1 image file,
However i need to expand it to upload the title, description, swf and gif file. I have the php to do this but just don't know how to do the actionscript/flash part.
Here is the php
PHP Code:
<?php
$accepted == true;
function error($message){
echo $message;
$accepted = false;
}
if($_POST['submit'] != NULL){
if($_POST['title'] == NULL){
error("You must enter a title for the game you are submitting.");
}
if($_POST['description'] == "-1" || $_POST['description'] == ""){
error("You must enter a Description for the game you are submitting.");
}
if(mysql_result(mysql_query("SELECT COUNT(id) FROM games WHERE title='".mysql_escape_string($_POST['title'])."'"), 0, 0) == 1){
error("The game title '".$_POST['title']."' already exists, please give the game a different name.");
}
if($_FILES["swf"] != NULL){
if($_FILES["swf"]["size"] > 5242880){
error("The SWF file cannot be over 5Mb.");
}
if($_FILES["swf"]["type"] != "application/x-shockwave-flash"){
error("The SWF file field must be a SWF file.");
}
}else{
error("You must select a SWF file.");
}
if($_FILES["preview"] != NULL){
if ($_FILES["file"]["size"] > 500000) {
error("The Image file cannot be over 50Kb.");
}
if(!strstr($_FILES["preview"]["type"], "image/gif")){
error("The Image file field must be a GIF format image file.");
}
}else{
error("You must select a preview image for the game.");
}
if($accepted){
move_uploaded_file($_FILES["preview"]["tmp_name"], "preview/".$_POST['title'].".gif");
move_uploaded_file($_FILES["swf"]["tmp_name"], "swf/".$_POST['title'].".swf");
mysql_query("INSERT INTO games (title, description, cat, visible) VALUES ('".mysql_escape_string($_POST['title'])."', '".$_POST['description']."', 12, 0)");
mysql_close();
mail("---", "Uploaded Game", getenv(REMOTE_ADDR)." has uploaded a new game called ".$_POST['title'], "---");
echo "<br>ThankYou for Uploading Your Game";
}
}
?>
Here is the actionscript
Code:
//import the FileReference Object
import flash.net.FileReference;
//initial settings
upload_butn.enabled = false;
//the fileReference object
var file_fr:FileReference = new FileReference();
//object for listening to for FileReference events
var list_obj:Object = new Object();
list_obj.onSelect = function(){
upload_butn.enabled = true;
name_txt.text = file_fr.name;
}
list_obj.onComplete = function(){
name_txt.text = "All Done";
rec_mc.clear();
upload_butn.enabled = false;
}
list_obj.onProgress = function (bytesTotal, bytesLoaded){
var percent = bytesLoaded/file_fr.size;
drawRec(percent);
}
//if a user selects cancel
list_obj.onCancel = function(){
name_txt.text = "Cancel was selected";
}
//if there is an IO error
list_obj.onIOError = function(fileRef){
name_txt.text = "IO error with " + fileRef.name;
}
//security error problem
list_obj.onSecurityError = function(fileRef, error){
name_txt.text = "Security error with " + fileRef.name + ":" + error;
}
//httpError
list_obj.onHTTPError = function(fileRef:FileReference, error:Number){
name_txt.text += "HTTP error: with " + fileRef.name + ":error #" + error;
}
//attach the listener
file_fr.addListener(list_obj);
//the event for the browse button
browse_butn.clickHandler = function(){
file_fr.browse([{description: "JPEGs", extension: "*.JPG;*.jpg"}]);
}
//the event for the upload button
upload_butn.clickHandler = function(){
file_fr.upload("upload.php");
rec_mc.fillColor = Math.random()*0x1000000;
}
//drawing the rectangle
function drawRec (per){
rec_mc.clear();
rec_mc.lineStyle(0);
rec_mc.beginFill(rec_mc.fillColor, 70);
rec_mc.lineTo(per*rec_mc._width, 0);
rec_mc.lineTo(per*rec_mc._width, rec_mc._height);
rec_mc.lineTo(0, 30);
rec_mc.lineTo(0,0);
rec_mc.endFill();
}
File Upload Form In Flash MX 2004 : Possible?
I'm curious if anyone has successfully attempted a file upload form in Flash.
If so, please push me in the right direction. Otherwise, if there's an effective workaround, I'd love some advice.
Cheers,
Mike
Flash Upload Form Does Not Recognize Foreign Characters
i have a flash form which uploads multimedia files and submit it to a java back-end along with other form fields. works for english characters but when it submits foreign characters such as chinese or spanish, the worlds are garbled on the other side. it seems like flash default is not set to utf-8, has anyone ever had seen this or had this problem before???
Upload Image To Flash Movie From Html Form
Any ideas (or links to threads/tutorials) on how to have a running flash movie provide an option to upload an image. I would like to use a pop up window with a html form with upload file field, upon submitting, the window closes and the image is uploaded into the flash movie.
My initial thought is to uses a loadvar.load directed at the html form URL and have the form pass the path to the recently uploaded image, which will need to be be uploaded to a temp directory on the server. Then the image is loaded to an empty movieclip.
Does that sound like the way to go or does someone have a better idea?
Thanks
Flash 8 Upload Form (Filereference) Examples Half Work
Hi
I'm trying to put together a simple upload form using Filereference.
But the examples I've found and tried to use don't quite work the way they should.
Example 1:
http://www.flash-db.com/Tutorials/upload/
I downloaded the source files, changed the
Code:
System.security.allowDomain("http://localhost", "127.0.0.1");
piece of it to reflect my domain name (although left the I.P alone)
and uploaded it to my server (created proper upload folder, with 777 permissions etc.. as well).
The script uploads the small files I've selected to the proper folder.
BUT after the swf tries to upload the file, it stops doing anything. The file gets uploaded, but the Swf file doesn't get any feedback, or doing anything. Just says thats its still trying to upload the file.
Example 2:
http://www.kirupa.com/developer/flas...erence_pg1.htm
I downloaded the Fla, published a HTML page and swf file from it, created a php script by copy pasting the code found on page 3 of the tutorial.
Uploaded the files, created proper upload directory, with 777 file permissions.
It does practically the same thing, I select a file with it, the file gets uploaded, but the progress bar doesn't show up, and the form doesn't reset itself. Its like as soon as the swf contacts the Php script, it doesn't do anything anymore.
Example 2 used to work the exact opposite though, a couple days ago when I first tried it, the files would trigger the upload progress bar, but would hang at some percentage (like 60%, 40% etc..) and the file wouldn't upload. Today I redownloaded the files, created a fresh directory on the server etc.. pretty much started from scratch, and now the files show up, but I don't get any feedback from the form.
I don't know what to do...
The other day I tried to add the lines of code mentioned on the 4th page of the example 2 tutorial, to the global .htaccess file, but those lines of code, proceeded to kill all other php scripts running on my website, they just stopped working and produced error messages. So I had to remove the code lines. Its probable worth mentioning that the .htaccess file already had some lines of code in it to handle the redirecting of a particular URL away from the main index page onto a sub folder and its index page (as suggested by my web host)
Heres the links to the examples that fail to work for me:
Example 1:
http://albertaintegrated.com/tests/f...01/upload.html
Example 2:
http://albertaintegrated.com/tests/f...eUploader.html
Heres the php scripts being used for them:
Example 1:
PHP Code:
<?php//create the directory if doesn't exists (should have write permissons)if(!is_dir("./files")) mkdir("./files", 0755); //move the uploaded filemove_uploaded_file($_FILES['Filedata']['tmp_name'], "./files/".$_FILES['Filedata']['name']);chmod("./files/".$_FILES['Filedata']['name'], 0777);?>
Example 2:
PHP Code:
<?php if ($_FILES['Filedata']['name']) { move_uploaded_file($_FILES['Filedata']['tmp_name'], 'upload_directory/' . basename($_FILES['Filedata']['name'])); }?>
And the links to the Flas involved are above.
Other then the change I mentioned I did on the Example 1 tutorial Fla, I assure you I left them untouched and identical to the ones you download from the tutorial pages.
I only need a simple Upload script. It doesn't have to upload multiple files at a time. I just need something that works, and is simple enough that I can attach it to a small contact form, that will email the users name and contact information, as well as the name(s) of the file(s) the user uploaded.
I'd appreciate any and ALL help, pointers, and suggestions you or others may offer.
Links to alternative tutorials and examples would also be appreciated.
Although, I need to be able to make the upload form look a certain way to fit in with the rest of the site (as well as make it fit within a certain size space) so I don't think some sort of component, where I couldn't rearrange the elements would work very well.
Thanks for your time
-Lem
Flash Upload Form (worked Until This Week) HTTP Error #500
Hi
I'm communicating with my web host about this problem, but it doesn't look promising thus far.
I've been using a Flash Upload form to allow clients to upload their files onto my site.
Its been working for months, with only minor problems cropping up. (mostly clients not seeing the file size limit posted above)
Anyway, now no matter how big, small, or what type of file you select to upload, the file goes through the motions of uploading it (progress status etc..) and just when its supposed to indicate a successful upload, I get this error "HTTP Error #500"
This error doesn't show up in my web host control panels Error logs, only on the form.
I'm confident that I haven't added anything of note (an image or two, and altered xml file thats it) within the last couple months. And I know I didn't touch the upload form and its scripts since its been last confirmed as working. And I haven't played with my My web host options either.
So I think my web host has done something, I just need proof. And hopefully a solution.
At any rate, I contacted them about them problem, they tested the form and say they didn't get any error. I immediately checked the upload directory using FTP, and their file did upload properly. I then tried it, and got the error, and the file vanishes (never ends up in the upload directory)
Thinking it was perhaps some browser specific error, I tried it on multiple computers.
Mac Safari, Mac Firefox, PC Internet Explorer. All get the same error. (btw I should point out that the Flash form itself displays the error in its dynamic text field. The Web page doesn't change)
I just threw together a dead simple html upload form and pointed it to the same PHP script that the Flash form points to (not a copy, the exact same one, in the same location etc..) and the test file uploaded.
So... It looks like whatever the problem is, its tied to Flash.
Did anything happen to Flash that could be responsible for this?
Could my web host, in its constant efforts to keep updating and improving their web hosting service, have enabled something that may now be conflicting with Flash?
I'm not sure what else to try, and I'm not looking forward to rebuilding the Flash form, especially if its Flash in general, and not this particular forms fault.
I need Flash to upload multiple files for me, activate multiple php scripts (notification and so on) and more things that I found difficult to find in more conventional scripts. All with an interface that matched well with the site.)
Well I hope that wasn't too much of a long winded post.
But I just didn't want to leave you with half information.
Thanks for your help.
Upload Button
im trying to get two buttons in flash the first browses your computer for a file then the second uploads the file. i tried to figure out the best way to do it, and im completly lost. anyhelp would be great thanks
randy
Upload Button
Hi there,
I wonder if there is a way to mimic the html upload button using action script..
ps:. I will use PHP to send the files to the server.
thanks
File Upload Button
I want to be able to let visitors upload files to my server, I have all the backend scripting for this. All I need to do is create the button that will, like in Internet Explorer popup the directory tree of there computer so they can search for a file and click ok, its path is then entered into the variable value. Is this possible in flash, or do you have any suggestions on how I may go about a soloution.
Many thanks in advance,
Danny
Photo Upload Button
Does anyone know if you can make a photo upload button in flash where the visitor can upload jpgs to my website? I've never seen it done.
Thanks
Upload Script (PHP) Call By FileReference.upload() Can't Read Cookie In NS Or FF
Finally I found the answers to my problem,
these are comment posted on Adobe.com
Hope there is a better solution from Adobe.
Quote:
When swf calling FileReference.upload(handlerURL) method, the handler (which is php server script) can't see session cookies
Steps to Reproduce:
1. page1> setcookie(cookiename,value)
2. page2 swf> FileReference.upload(handlerURL)
3. handlerURL (serverscript)> getcookie(cookiename) return null
Quote:
I CONFIRM THE SESSION COOKIE NOT BEEING SENT WITH THE FILE-UPLOAD POST REQUEST IN FIREFOX 1.5 (NOT TESTED WITH 1.0.X).
THE MULTIPLE FILE UPLOAD FLASH COMPONENT IS USELLES UNTIL THIS BUG IS FIXED BECAUSE WE NEED A SESSION ON THE SERVER SIDE.
Quote:
UPLOAD SESSION COOKIE BUG SOLUTION:
THIS IS HOW TO BYPASS THE BUG ON FIREFOX AND SAFARI WHERE THE SESSION COOKIE IS (UNFORTUNATELY) NOT SENT BY THE FLASH PLAYER.
- IN THE HTML PAGE CREATE A JAVASCRIPT FUNCTION GETCOOKIE() THAT RETURNS THE SESSION COOKIE LOCATED IN 'DOCUMENT.COOKIE' , FOR INSTANCE IF YOU ARE USING PHP IT SHOULD BE NAMED 'PHPSESSID' BY DEFAULT.
- CALL THIS FUNCTION FROM FLASH USING THE EXTERNAL INTERFACE:
VAR COOKIE = STRING(EXTERNALINTERFACE.CALL("GETCOOKIE"));
- APPEND THE COOKIE TO YOUR UPLOAD URL:
.UPLOAD( "/UPLOAD.PHP?"+COOKIE)
VOILA.
ATTENTION:
- DON'T REGENERATE THE COOKIE DURING A SERVER CALL FROM FLASH, BECAUSE THE JAVASCRIPT WILL RETURN ONLY THE COOKIE FROM THE HTML PAGE HOLDING THE SWF.
- UNFORTUNATELY THIS DOESN'T WORK ON OPERA, BECAUSE THE EXTERNAL INTERFACE DOES NOT SUPPORT IT.
- AND CLEAR YOUR COOKIES BEFORE TESTING OF COURSE...
HOPE THIS HELPS...
FRANK.
Quote:
JUST ANOTHER CONFIRMATION: FILE UPLOAD PLUS SESSION COOKIES FAILS ON MAC WITH FIREFOX AND SAFARI, FLASH VERSIONS 8,0,27,0 AND 9,0,20,0. THE FILE GETS UPLOADED JUST FINE BUT THE COOKIES DO NOT GET SET IN THE HTTP REQUEST HEADER.
THIS TYPE OF BUG MAKES ME RECONSIDER POSSIBLY USING FLEX FOR APPLICATION DEPLOYMENT AND REVERT TO JAVASCRIPT + HTML OR JAVA.
more to read:
http://www.visible-form.com/blog/fla...ssion-cookies/
http://robrosenbaum.com/flash/using-...h-php-symfony/
Hope these comments help and save you some time when it happens to you.
Can We Upload Movieclip To Some Server Using Filereference.upload() Method?
hi to all
can we upload movieclip to some server using filereference.upload() method?
i know filereference upload files that only resides on localdisk and that we select using browse methods but is it possible that we convert movieclip which contains single image to filereference object so that we can upload it using filereference.upload() method?
thanks
mjanjua
Upload Page ...user Can Upload An Image
Im trying to figure out how I can create a page as described.
I want the customer to be able to go to blbla.html and click browse where appropriate and select the image that he/she wants to upload to the server.
How can I accomplish this in Flash, PHP, or straight HTML. I have a few ideas but never really dealt with someone having that kind of access to a server.
Any help would be great! I would prefer to do this in Flash for usability purposes. thanks!
Bug In FileReference: Upload->cancel->upload Not Possible
Hi,
i have written an uploader flash to upload multiple files one after another to a server.
I want to be able to cancel the uploading of a list of filerefences and continue later.
But when i cancel an ongoing upload it is not possible to upload that filereference-object again.
During the second call of upload (after a cancel before) the progress-events are still fired, but not the complete/httperror events. So effectively the upload keeps hanging at the previously canceled filereference.
I tried with Flash 8 and Flash CS3 - with both it was the same problem.
Can anyone confirm this?
Best regards,
Thomas
Upload-script Doesn't Upload
I'm trying to make a button which can upload multiple files in Flash.
This is my code so far:
AS3: http://pastie.org/320443
PHP: http://pastie.org/320444
The problem is that the console in Flash does say that the files are uploaded, but they are not.
I've tried to replace the PHP to just echo "test"; and Flash still says it is uploaded.
So what is wrong with the script and why does Flash says that files are uploaded when they aren't?
How To Make A Button In Flash Work As A Form Button?
I'm trying to figure out how to use a button in flash as a form button. I have all of this HTML:
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="julie1@juliedesigns.com">
<input type="hidden" name="item_name" value="picture">
<input type="hidden" name="item_number" value="picture1">
<input type="hidden" name="amount" value="10.00">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
</form>
And I want to be able to make button in flash be able to do what that form button would. Anyone know how to do this?
FORM A SEND BUTTON
Hi. My name is paulo and i´d like to know if anybody could send me a code to put on a button for my form. it´s a form in flash, and i´d like to send the results to my email,if possible, without any other languages, like asp, php3, etc. could anybody help me?
thanx!!
paulo52
Using Button To Validate Form
It's my first time I'm making a form in flash. As to how to validate, I'm not exactly sure. My idea was that when you hit the submit button, it does the validation and if any of the validations fail, it sets a dont-submit flag and displays an error message in the form of a box that pops up. Anyways, it doesn't seem to work: the box isn't poping up or anything else. Any ideas?
I defined error in my form frame actions:
function error(message) {
errorBox._visible = true;
errorBox.message = message;
}
And heres my code for the submit button:
on (release) {
submitGo = true;
// Checks
if (_root.name == "" || _root.name == " ") {
error("Please tell us your name.");
submitGo = false;
}
if (_root.company == "" || _root.company == " ") {
error("Please tell us your company name.");
submitGo = false;
}
if (_root.phone == "" || _root.phone == " ") {
error("Please tell us a phone number where we can contact you.");
submitGo = false;
}
if (_root.email == "" || _root.email == " ") {
error("Please tell us an e-mail address where we can contact you.");
submitGo = false;
}
if (_root.feedback == "" || _root.feedback == " ") {
error("Please give us some feedback.");
submitGo = false;
}
// Sending vars
if (submitGo == true) {
loadVariablesNum ("infoRecieve.asp", 0, "POST");
}
}
Form Submit Button Help
ok, so I'm a n00b when it comes to flash, but I'm trying to learn...
I have a flash form with a submit and clear button, but the button is not working.. No idea why..
Basically what I need(could not find) the scripting code to pull another part of the flash doc.
Bsically I have a form, when you hit submit it checks the form to make sure it was filled out correclty and it it was it pops up a msg saying Thank you etc.
If you did not fill it out correctly it pops up a message and tell you to fill out the proper field according to whatever error..
Here is a screenshot of my form:
http://12.224.237.169/temp/flash.jpg
Here is my form in action:
http://12.224.237.169/contact_test.shtml
My code that I have:
Code:
on (release) {
if ((txtName == "") || (txtName.length<3)) {
setProperty ("popup", _visible, "1");
popup.message = "Please fill in your name";
} else if ((txtEmail == "") || (txtEmail.length<5)) {
setProperty ("popup", _visible, "1");
popup.message = "Please fill in you're email address";
} else if (buscarroba == (-1)) {
setProperty ("popup", _visible, "1");
popup.message = "Please fill in all fields";
} else if (buscapunto == (-1)) {
setProperty ("popup", _visible, "1");
popup.message = "Please fill in all fields";
} else if (message.length<10) {
setProperty ("popup", _visible, "1");
popup.message = "Please fill in all fields";
} else {
loadVariables ("contactar.asp", "", "POST");
setProperty ("popup", _visible, "1");
popup.message = "Waiting for server. . . ";
}
}
I have ASP, and PHP installed on the server.
Thanx for the help!
Reset Form Button?
Hi guys
whats the code needed ro reset a form in flash ?
I have created a form and I need the user to be able to rest it in case of a mistake.
|