Sometings Wrong With My Upload Script

Started on the old forum in November 2007 · view the original in the archive · old links redirect here

9 replies · 677 views · started 19 years ago · 1 min read

2 participants
Guest #1

the jpeg upload works fine n my host also supports all these files then whats wrong

<?php

if (($_FILES["file"]["type"] == "application/java")

|| ($_FILES["file"]["type"] == "application/java-archive")

|| ($_FILES["file"]["type"] == "text/vnd.sun.j2me.app-descriptor")

|| ($_FILES["file"]["type"] == "application/x-java-archive")

|| ($_FILES["file"]["type"] == "application/vnd.symbian.install")

|| ($_FILES["file"]["type"] == "image/jpeg")

|| ($_FILES["file"]["type"] == "image/pjpeg")

&& ($_FILES["file"]["size"] < 200000000000000))

  {

  if ($_FILES["file"]["error"] > 0)

    {

    echo "Return Code: " . $_FILES["file"]["error"] . "
";

echo"[url="'http://nahsorhseda.wen9.com/'><img"][/url]
";

    }

  else

    {

    echo "Upload: " . $_FILES["file"]["name"] . "
";

    echo "Type: " . $_FILES["file"]["type"] . "
";

    echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb
";

    echo "Temp file: " . $_FILES["file"]["tmp_name"] . "
";

    if (file_exists("wapbuddy/sis_apps/" . $_FILES["file"]["name"]))

      {

      echo $_FILES["file"]["name"] . " already exists. ";

echo"[url="'http://nahsorhseda.wen9.com/'><img"][/url]
";

      }

    else

      {

      move_uploaded_file($_FILES["file"]["tmp_name"],

      "wapbuddy/sis_apps/" . $_FILES["file"]["name"]);

      echo "Stored in: " . "downloadmanager/sis_apps/" . $_FILES["file"]["name"];

      echo"[url="'http://nahsorhseda.wen9.com/'><img"][/url]
";

      }

    }

  }

else

  {

  echo "Invalid file";

echo"[url="'http://nahsorhseda.wen9.com/'><img"][/url]
";

  }

?>

 
Guest #3

try my uploader

can you please give a download link

GumSlone Administrator Principal · 1,690 posts #4

the jpeg upload works fine n my host also supports all these files then whats wrong

<?php

if (($_FILES["file"]["type"] == "application/java")

|| ($_FILES["file"]["type"] == "application/java-archive")

|| ($_FILES["file"]["type"] == "text/vnd.sun.j2me.app-descriptor")

|| ($_FILES["file"]["type"] == "application/x-java-archive")

|| ($_FILES["file"]["type"] == "application/vnd.symbian.install")

|| ($_FILES["file"]["type"] == "image/jpeg")

|| ($_FILES["file"]["type"] == "image/pjpeg")

&& ($_FILES["file"]["size"] < 200000000000000))

  {

  if ($_FILES["file"]["error"] > 0)

    {

    echo "Return Code: " . $_FILES["file"]["error"] . "
";

echo"
";

    }

  else

    {

    echo "Upload: " . $_FILES["file"]["name"] . "
";

    echo "Type: " . $_FILES["file"]["type"] . "
";

    echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb
";

    echo "Temp file: " . $_FILES["file"]["tmp_name"] . "
";

    if (file_exists("wapbuddy/sis_apps/" . $_FILES["file"]["name"]))

      {

      echo $_FILES["file"]["name"] . " already exists. ";

echo"
";

      }

    else

      {

      move_uploaded_file($_FILES["file"]["tmp_name"],

      "wapbuddy/sis_apps/" . $_FILES["file"]["name"]);

      echo "Stored in: " . "downloadmanager/sis_apps/" . $_FILES["file"]["name"];

      echo"
";

      }

    }

  }

else

  {

  echo "Invalid file";

echo"
";

  }

?>
 

i think you need the mime magic mod to let it work

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

Guest #7

ya but i tryin to make my own scripts , u see iam beginner at php if i just star  usin someone elses  scripts ,i wont learn , one can learn only from his mistakes ,i ll appreciate if u just find whats the mistake with the script

and thanks in advance

Guest #8

ya but i tryin to make my own scripts , u see iam beginner at php if i just star  usin someone elses  scripts ,i wont learn , one can learn only from his mistakes ,i ll appreciate if u just find whats the mistake with the script

and thanks in advance

Guest #9

ya but i tryin to make my own scripts , u see iam beginner at php if i just star  usin someone elses  scripts ,i wont learn , one can learn only from his mistakes ,i ll appreciate if u just find whats the mistake with the script and thanks in advance

you her gums, you need mime magic module, it is turned off on many servers...

Guest #10

you her gums, you need mime magic module, it is turned off on many servers...

how do i turn it on ,i use cpanel hosting n they allow me to add mime types .if possible please tell me how to turn it on

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close