Jump to content


Photo

File Upload From Remote Device


  • Please log in to reply
No replies to this topic

#1 snowdog

snowdog

    Advanced Member

  • Members
  • PipPipPip
  • 107 posts

Posted 23 January 2013 - 03:47 PM

I will try to explain this and make it simple. I am having a iphone app and I have been able to interact with it no problems until it comes down to the file upload now. I have never done file uploads from a form before. There could be anywhere from 1-4 pictures and it will be:

4 $_FILES in a photos[] array, with the file names:

wheelFL.jpeg
wheelFR.jpeg
wheelRL.jpeg
wheelRR.jpeg

Here is the code I have written so far, the files need to be uploaded to a directory called franchises/1

// SEND API


if ( isset($_POST["send"])) 
{
$dealer = $_POST['dealer'];
$vinNumber = $_POST['vinNumber'];
$carMake = ['carMake'];
$carModel = ['carModel'];
$carYear = ['carYear'];


$franchise_id = $_SESSION['franchise_id'];


// INSERT THE INFO INTO THE LOT DATABASE


$SQL = "INSERT INTO lot (franchise_id,dealer_id,vinNumber,carMake,carModel,carYear,created,modified)
   VALUES ('$franchise_id','$dealer_id','$vinNumber','$carMake','$carModel','$carYear',NOW(),NOW())";


$result = mysql_query($SQL) or die('Query failed: ' . mysql_error());  



$lot_id = mysql_insert_id();


// UPLOAD THE PICTURES OF THE RIMS 

}


I am feeling completely lost on the file upload thing here.

Thanks for any help.


Snowdog




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com