Kod wygląda tak
<?php // Path to move uploaded files $target_path = "uploads/"; // array for final json respone // getting server ip address $server_ip = gethostbyname(gethostname()); // final file url that is being uploaded $file_upload_url = 'http://brzanek.webd.pl/AndroidFileUpload/uploads/'; $response['email'] = $email; $response['website'] = $website; try { // Throws exception incase file is not being moved // make error flag true $response['error'] = true; $response['message'] = 'Could not move the file!'; } // File successfully uploaded $response['message'] = 'File uploaded successfully!'; $response['error'] = false; } //$con = new mysqli("localhost","brzanek_brzanek","dj4403dj","brzanek_android"); //$date = date('hisdmY'); //$date = date('Y-m-d'); //$image = $_POST['image']; catch (Exception $e) { // Exception occurred. Make error flag true $response['error'] = true; $response['message'] = $e->getMessage(); } } else { // File parameter is missing $response['error'] = true; $response['message'] = 'Not received any file!F'; } // Echo final json response to client ?>
Chciałbym dołączyć do tego możliwość zapisywania nazwy zdjęcia w bazie danych. Mam już przygotowaną bazę danych z trzema kolumnami.
- id
- data
- image
Jak dopisać to w tym pliku php aby to zadziałało. Próbowałem standardowo jak to się robi za pomocą formularza ale nie wychodziło. Proszę o pomoc z góry dziękuję.