The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Upload with link
#10
Ok, I got the file to upload, but now I cant get it to post into into the db (I managed to before but forgot how)

Hopefully you guys can help me.


Code:
if(isset($_POST['btn-upload']))
Code:
{

Code:
$file = rand(1000,100000)."-".$_FILES['file']['name'];
Code:
$file_loc = $_FILES['file']['tmp_name'];
Code:
$file_size = $_FILES['file']['size'];
Code:
$file_type = $_FILES['file']['type'];
Code:
$folder="cvs/";

// new file size in KB
Code:
$new_size = $file_size/1024;
// new file size in KB

// make file name in lower case
Code:
$new_file_name = strtolower($file);
// make file name in lower case

Code:
$final_file=str_replace(' ','-',$new_file_name);

Code:
if(move_uploaded_file($file_loc,$folder.$final_file))
Code:
{
` $sql="INSERT INTO users(file,type,size) VALUES('$final_file','$file_type','$new_size')";
mysql_query($sql);`
Code:
?>
  Reply


Messages In This Thread
Upload with link - by Disruptionz - 09-12-2016, 08:29 PM
Upload with link - by mudmin - 09-12-2016, 09:42 PM
Upload with link - by Disruptionz - 09-13-2016, 05:25 AM
Upload with link - by Disruptionz - 09-13-2016, 07:26 AM
Upload with link - by Disruptionz - 09-13-2016, 09:19 AM
Upload with link - by brian - 09-14-2016, 01:26 PM
Upload with link - by firestorm - 09-14-2016, 03:23 PM
Upload with link - by brian - 09-14-2016, 05:02 PM
Upload with link - by Disruptionz - 09-16-2016, 06:40 AM
Upload with link - by Disruptionz - 09-16-2016, 07:22 AM
Upload with link - by brian - 09-16-2016, 10:46 AM
Upload with link - by Disruptionz - 09-16-2016, 05:53 PM
Upload with link - by mudmin - 09-19-2016, 11:48 AM
Upload with link - by picassoo - 10-07-2016, 03:55 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)