Jump to content

Search the Community

Showing results for tags 'image uploading'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Dear all, I have the following code for storing an image in and fetching it from a MySQL DB: <html> <body> <form action="index.php" method="POST" enctype="multipart/form-data"> File: <input type="file" name="image"> <input type="submit" value="upload"> </form> <?php mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("code_new") or die(mysql_error()); $file = $_FILES['image']['tmp_name']; if(!isset($file)) { echo 'Please select a file'; } else { $image = addslashes(file_get_contents($_FILES['image']['tmp_name'])); $image_name = addslashes($_FILES['image']['name']); $image_size = getimagesize($_FILES['image']['tmp_name']); if ($image_size == FALSE) echo 'This is not an image.'; else { if(!$insert = mysql_query("INSERT INTO lash VALUES ('', '$image_name', '$image')")) { echo 'Problem uploading the image.'; } else { $lastid = mysql_insert_id(); echo "Image uploaded.<p />Your Image:<p /><img src=get.php?id=$lastid>"; } } } ?> </body> </html> No need to include get.php and the DB. To test the if statement in red, I attempted to upload a pdf file and it functioned well. It also uploaded various images. But when I attempted to upload a docx file (word), the following occurred: Warning: POST Content-Length of 9069583 bytes exceeds the limit of 8388608 bytes in Unknown on line 0 What is the meaning of this warning and what are the Unknown and line 0?
×
×
  • Create New...