Forum Moderators: coopster
<input name="frm_title" type="text" id="frm_title" size="50" />
<input type="file" id="uploadedfile" name="uploadedfile"/>
<textarea name="frm_desc" id="frm_desc" cols="47" rows="5"></textarea>
<input name="form_posted" type="hidden" value="true" />
<input name="btn_save" type="submit" class="bg-blue" value="Save and Continue" />
</form>
[END OF HTML]
code to capture the posted data:
[PHP]
<?php
if(isset($_POST['form_posted'])){
$query = "insert into latest_news_tb(title,description)values('$_POST[frm_title]','$_POST[frm_desc]')";
$db = new Database();
$return_id = $db->query_mysql_insert_id($query);
$target_path = "../media_centre/images_media/";
$target_path = $target_path."LN".$return_id.".jpg";
$name = $_FILES['uploadedfile']['tmp_name'];
print $name;
print_r($_FILES);
//if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
//print 'file uploaded';
//}
?>
[END OF PHP]
here I'm trying to upload the file. but $_FILES['uploadedfile']['tmp_name'] is empty. why is that?
gettin the $return_id works fine.
tried the following:
1.upload a tiny image to see whether the problem was with the MAX_FILE_SIZE
2.made the folder file permissions to 777.
3. the disk also have enough space
so,
how is this possible?
even the $_FILES['uploadedfile']['name'], $_FILES['uploadedfile']['size'] is empty.
Thanks in advance!
;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;
; Whether to allow HTTP file uploads.
file_uploads = On
; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
;upload_tmp_dir =
; Maximum allowed size for uploaded files.
upload_max_filesize = 8M
well the other uploading parts are working well too. sigh sigh!