for example: i uploaded a 200k jpeg file from my computer, but after upload it lists as 130k on the server. to make sure it wasn't just a wrongfully info display, i downloaded the 130k file on to my computer and listed in the files info window states that infact the downloaded file is 130k, not 200k like the original. the file looks identical to the original 200k file, but the file size is different...
i'm concerned the upload has compressed the jpeg file. this is my code:
HTML code:
Expand|Select|Wrap|Line Numbers
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- </head>
- <body>
- <form enctype="multipart/form-data" action="uploadtest.php" method="POST">
- <input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
- Choose a file to upload:<br /> <input name="datafileA" type="file" /><br />
- <input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
- Choose a file to upload:<br /> <input name="datafileB" type="file" />
- <br /><br />
- <input type="submit" value="SUBMIT" />
- </form>
- </body>
- </html>
Expand|Select|Wrap|Line Numbers
- <?php
- $uploadfolder = "uploads/";
- $uploadfileA = $uploadfolder . basename($_FILES['datafileA']['name']);
- $uploadfileB = $uploadfolder . basename($_FILES['datafileB']['name']);
- if (move_uploaded_file($_FILES['datafileA']['tmp_name'], $uploadfileA))
- {
- echo "Successful upload File A.\n\n";
- }
- else
- {
- echo "File Field A Was Empty... But That's No Problem.\n\n";
- }
- if (move_uploaded_file($_FILES['datafileB']['tmp_name'], $uploadfileB))
- {
- echo "Successful upload File B.\n\n";
- }
- else
- {
- echo "File Field B Was Empty... But That's No Problem.\n\n";
- }
- ?>