Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6942809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:04:23+00:00 2026-05-27T13:04:23+00:00

Ive been trying to create this code for some time now and just wondered

  • 0

Ive been trying to create this code for some time now and just wondered if someone out there who may read code better than me may work out why the image doesnt end up on my server as i seem to have brain freeze on this 🙁

var fileRef:FileReference = new FileReference(); 
fileRef.addEventListener(Event.SELECT, selectHandler); 
fileRef.addEventListener(Event.COMPLETE, completeHandler); 
try 
{ 
var success:Boolean = fileRef.browse(); 
} 
catch (error:Error) 
{ 
trace("Unable to browse for files."); 
} 
function selectHandler(event:Event):void 
{ 
var request:URLRequest = new URLRequest("http://localhost/upload.php") 
try 
{ 
fileRef.upload(request); 
} 
catch (error:Error) 
{ 
trace("Unable to upload file."); 
} 
} 
function completeHandler(event:Event):void 
{ 
trace("uploaded"); 
}
customerService.createClients(SlagsData);
}

And then here is the php on the server

<?php
define('UPLOAD_DIR', 'c:/wamp/www/IMAGES/');
define('UPLOAD_DIR_default', 'c:/wamp/www/IMAGES/0/image01.jpg');
$hostname_thatexclients = "localhost";
$database_thatexclients = "myexclients";
$username_thatexclients = "root";
$password_thatexclients = "";
$thatexclients = mysql_connect($hostname_thatexclients, $username_thatexclients,   $password_thatexclients) or trigger_error(mysql_error(),E_USER_ERROR); 
set_time_limit ( 240 );




if($_FILES['yourpic']['size'] > 1) 
{
if($_FILES['yourpic']['size'] < 5000000) 
$newname = "image01.jpg";
$id = 0;
$query = ("SELECT * FROM clients WHERE  ID = (SELECT MAX(ID) FROM clients)") or die(mysql_error());
mysql_select_db($database_thatexclients, $thatexclients);
$Result2 = mysql_query($query, $thatexclients) or die(mysql_error());
While($row = mysql_fetch_array($Result2))
{
$id = $row["ID"];
$id = ($id + "1");
}  
mkdir(UPLOAD_DIR.$id, 0777, true) or die ("Could not make directory"); 
$idr = ($id.'/');  
move_uploaded_file($_FILES['yourpic']['tmp_name'],UPLOAD_DIR.$idr .$newname);// this one works  
}
else
{
$id = 0;
}

?>

Any help would be great 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:04:24+00:00Added an answer on May 27, 2026 at 1:04 pm

    Ok well how embarrassing would seem the code was working all the time just must of been a dodgy .jpeg picture

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've recently been trying to create units tests for some legacy code. I've been
I've been trying to create some php code that would let me take input
i am trying to create a fade effect with the following...ive been told im
I'm trying to understand some code I've been given. It works in a similar
I've been trying to debug this for 2 hours and i just can't explain
I'm trying to create some dynamic code within clojure. In the function below, the
I've been trying to implement a robust voting system in Rails for some time
So, I've been playing with trying to create an AppBar program I'm making. Now,
I've got this workbook I've been trying to get to work via macro code.
I've been trying to create a Windows Media Player plugin in Visual Studio 2008,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.