" /> Uploader Problem


Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Apr 2006
    Posts
    1,463
    Tokens
    0

    Latest Awards:

    Default Uploader Problem

    Ok im making a Uploader for a Friend.
    http://www.twoupload.com/uploader.php
    Ok uploads fine but he redirect dosent work.
    Upload and see!
    Could you hep me with this

  2. #2
    Join Date
    Jul 2007
    Location
    Swindon
    Posts
    990
    Tokens
    125

    Default

    post the code, don't think you have set the $_get eg up or u dont have the file upload.php

  3. #3
    Join Date
    Apr 2006
    Posts
    1,463
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Eccentric View Post
    post the code, don't think you have set the $_get eg up or u dont have the file upload.php
    <?
    // Script Made By Ashley Cusack
    // CONFIG
    $siteurl = "http://www.twoupload.com"; //Must Include http:// and www. ending in where the images upload to with NO trailing slash
    $serverpath = "images/"; // The End of the part above
    $urltoimages = "$siteurl"; // Web address to where the images are accessible from.
    $maxsize = "10000"; // Maximum size of the file people can upload
    $uniq = uniqid("");
    // CONFIG END
    $mode = $_GET['mode'];
    if ($mode == "") { $mode = "form"; }
    if ($mode == "form") {
    echo "<form enctype='multipart/form-data' method='post' action='upload.php?mode=upload'>\n";
    echo "Upload file: <input type='file' name='file'>\n";
    echo "<br><input type='submit' name='Submit' value='Upload'>\n";
    $bytesize = "1000";
    $kb = $maxsize/$bytesize;
    echo "<br>Maximum File Size: $kb Kilobytes <em>($maxsize Bytes)</em>";
    }
    if ($mode == "upload") {
    $file = $_FILES['file']['name'];
    $name = time() . substr($file, -4);
    // If you add your own file types don't forget to add an uppercase version.
    $allowedfiles[] = "gif";
    $allowedfiles[] = "jpg";
    $allowedfiles[] = "jpeg";
    $allowedfiles[] = "jfef";
    $allowedfiles[] = "jpe";
    $allowedfiles[] = "png";
    $allowedfiles[] = "GIF";
    $allowedfiles[] = "JPG";
    $allowedfiles[] = "JPEG";
    $allowedfiles[] = "JFEF";
    $allowedfiles[] = "JPE";
    $allowedfiles[] = "PNG";
    $allowedfiles[] = "PDF";
    $allowedfiles[] = "pdf";
    $allowedfiles[] = "PSD";
    $allowedfiles[] = "psd";
    $allowedfiles[] = "bmp";
    $allowedfiles[] = "BMP";
    $allowedfiles[] = "tif";
    $allowedfiles[] = "tiff";
    $allowedfiles[] = "TIF";
    $allowedfiles[] = "TIFF";
    $allowedfiles[] = "dib";
    $allowedfiles[] = "DIB";
    $allowedfiles[] = "sql";
    if($_FILES['file']['size'] > $maxsize)
    {
    print "File size is too big - please reduce file size and try again.";
    }
    else {
    $path = "$serverpath/" . $name;
    foreach($allowedfiles as $allowedfile) {

    if ($done <> "yes") {
    if (file_exists($path)) {
    echo "A file with this name already exists - please rename the file and reupload.";
    exit;
    }
    }

    if (substr($file, -3) == $allowedfile) {
    move_uploaded_file($_FILES['file']['tmp_name'], "$path");
    $done = "yes";
    echo "<p>Your image has been successfully uploaded to our server and can be accessed using the URL provided below.</p>";
    echo "<p>Please Note we do not take any responsibility of the images that you upload</p>";
    ?>
    <!-- All the kinds of code you want to be outputed go here -->
    <img src="<?php echo "$urltoimages/$name" ?>">
    <br>Direct Link: <input name='direct' type='text' align='center' size='70' value='<?php echo "$urltoimages/$name" ?>'>
    <br> BB Code:<input name='bbcode1' type='text' align='center' size='70' value='[img=<?php echo "$urltoimages/$name" ?>]'>
    <br> BB Code: <input name='bbcode2' type='text' align='center' size='70' value='[img]<?php echo "$urltoimages/$name" ?>[/img]'>
    <!-- End of all HTML Code -->
    <?php

    }
    }
    if ($done <> "yes") { print "<p><b>Error:</b> Your image as not been uploaded becuase it is not a recognised image file. Please try again.</p>"; }
    }
    }
    ?>

    I havent set the redirect up Yet because didnt know how!

  4. #4
    Join Date
    Jul 2007
    Location
    Swindon
    Posts
    990
    Tokens
    125

    Default

    ok O.o
    Code:
    echo "<form enctype='multipart/form-data' method='post' action='upload.php?mode=upload'>\n";
    that is the line you need sir.

  5. #5
    Join Date
    Apr 2006
    Posts
    1,463
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Eccentric View Post
    ok O.o
    Code:
    echo "<form enctype='multipart/form-data' method='post' action='upload.php?mode=upload'>\n";
    that is the line you need sir.
    Where do I put that

  6. #6
    Join Date
    Jul 2007
    Location
    Swindon
    Posts
    990
    Tokens
    125

    Default

    try;
    Code:
    <?
    // Script Made By Ashley Cusack
    // CONFIG
    $siteurl = "http://www.twoupload.com"; //Must Include http:// and www. ending in where the images upload to with NO trailing slash
    $serverpath = "images/"; // The End of the part above
    $urltoimages = "$siteurl"; // Web address to where the images are accessible from.
    $maxsize = "10000"; // Maximum size of the file people can upload
    $uniq = uniqid("");
    // CONFIG END
    $mode = $_GET['mode'];
    if ($mode == "") { $mode = "form"; }
    if ($mode == "form") {
    echo "<form enctype='multipart/form-data' method='post' action='uploader.php?mode=upload'>\n";
    echo "Upload file: <input type='file' name='file'>\n";
    echo "<br><input type='submit' name='Submit' value='Upload'>\n";
    $bytesize = "1000";
    $kb = $maxsize/$bytesize;
    echo "<br>Maximum File Size: $kb Kilobytes <em>($maxsize Bytes)</em>";
    }
    if ($mode == "upload") {
    $file = $_FILES['file']['name'];
    $name = time() . substr($file, -4);
    // If you add your own file types don't forget to add an uppercase version.
    $allowedfiles[] = "gif";
    $allowedfiles[] = "jpg";
    $allowedfiles[] = "jpeg";
    $allowedfiles[] = "jfef";
    $allowedfiles[] = "jpe";
    $allowedfiles[] = "png";
    $allowedfiles[] = "GIF";
    $allowedfiles[] = "JPG";
    $allowedfiles[] = "JPEG";
    $allowedfiles[] = "JFEF";
    $allowedfiles[] = "JPE";
    $allowedfiles[] = "PNG";
    $allowedfiles[] = "PDF";
    $allowedfiles[] = "pdf";
    $allowedfiles[] = "PSD";
    $allowedfiles[] = "psd";
    $allowedfiles[] = "bmp";
    $allowedfiles[] = "BMP";
    $allowedfiles[] = "tif";
    $allowedfiles[] = "tiff";
    $allowedfiles[] = "TIF";
    $allowedfiles[] = "TIFF";
    $allowedfiles[] = "dib";
    $allowedfiles[] = "DIB";
    $allowedfiles[] = "sql";
    if($_FILES['file']['size'] > $maxsize)
    {
    print "File size is too big - please reduce file size and try again.";
    }
    else {
    $path = "$serverpath/" . $name;
    foreach($allowedfiles as $allowedfile) {
    
    if ($done <> "yes") {
    if (file_exists($path)) {
    echo "A file with this name already exists - please rename the file and reupload.";
    exit;
    }
    }
    
    if (substr($file, -3) == $allowedfile) {
    move_uploaded_file($_FILES['file']['tmp_name'], "$path");
    $done = "yes";
    echo "<p>Your image has been successfully uploaded to our server and can be accessed using the URL provided below.</p>";
    echo "<p>Please Note we do not take any responsibility of the images that you upload</p>";
    ?>
    <!-- All the kinds of code you want to be outputed go here -->
    <img src="<?php echo "$urltoimages/$name" ?>">
    <br>Direct Link: <input name='direct' type='text' align='center' size='70' value='<?php echo "$urltoimages/$name" ?>'>
    <br> BB Code:<input name='bbcode1' type='text' align='center' size='70' value='[img=<?php echo "$urltoimages/$name" ?>]'>
    <br> BB Code: <input name='bbcode2' type='text' align='center' size='70' value='[img]<?php echo "$urltoimages/$name" ?>[/img]'>
    <!-- End of all HTML Code -->
    <?php
    
    }
    }
    if ($done <> "yes") { print "<p><b>Error:</b> Your image as not been uploaded becuase it is not a recognised image file. Please try again.</p>"; }
    }
    }
    ?>

  7. #7
    Join Date
    Apr 2006
    Posts
    1,463
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Eccentric View Post
    try;
    Code:
    <?
    // Script Made By Ashley Cusack
    // CONFIG
    $siteurl = "http://www.twoupload.com"; //Must Include http:// and www. ending in where the images upload to with NO trailing slash
    $serverpath = "images/"; // The End of the part above
    $urltoimages = "$siteurl"; // Web address to where the images are accessible from.
    $maxsize = "10000"; // Maximum size of the file people can upload
    $uniq = uniqid("");
    // CONFIG END
    $mode = $_GET['mode'];
    if ($mode == "") { $mode = "form"; }
    if ($mode == "form") {
    echo "<form enctype='multipart/form-data' method='post' action='uploader.php?mode=upload'>\n";
    echo "Upload file: <input type='file' name='file'>\n";
    echo "<br><input type='submit' name='Submit' value='Upload'>\n";
    $bytesize = "1000";
    $kb = $maxsize/$bytesize;
    echo "<br>Maximum File Size: $kb Kilobytes <em>($maxsize Bytes)</em>";
    }
    if ($mode == "upload") {
    $file = $_FILES['file']['name'];
    $name = time() . substr($file, -4);
    // If you add your own file types don't forget to add an uppercase version.
    $allowedfiles[] = "gif";
    $allowedfiles[] = "jpg";
    $allowedfiles[] = "jpeg";
    $allowedfiles[] = "jfef";
    $allowedfiles[] = "jpe";
    $allowedfiles[] = "png";
    $allowedfiles[] = "GIF";
    $allowedfiles[] = "JPG";
    $allowedfiles[] = "JPEG";
    $allowedfiles[] = "JFEF";
    $allowedfiles[] = "JPE";
    $allowedfiles[] = "PNG";
    $allowedfiles[] = "PDF";
    $allowedfiles[] = "pdf";
    $allowedfiles[] = "PSD";
    $allowedfiles[] = "psd";
    $allowedfiles[] = "bmp";
    $allowedfiles[] = "BMP";
    $allowedfiles[] = "tif";
    $allowedfiles[] = "tiff";
    $allowedfiles[] = "TIF";
    $allowedfiles[] = "TIFF";
    $allowedfiles[] = "dib";
    $allowedfiles[] = "DIB";
    $allowedfiles[] = "sql";
    if($_FILES['file']['size'] > $maxsize)
    {
    print "File size is too big - please reduce file size and try again.";
    }
    else {
    $path = "$serverpath/" . $name;
    foreach($allowedfiles as $allowedfile) {
     
    if ($done <> "yes") {
    if (file_exists($path)) {
    echo "A file with this name already exists - please rename the file and reupload.";
    exit;
    }
    }
     
    if (substr($file, -3) == $allowedfile) {
    move_uploaded_file($_FILES['file']['tmp_name'], "$path");
    $done = "yes";
    echo "<p>Your image has been successfully uploaded to our server and can be accessed using the URL provided below.</p>";
    echo "<p>Please Note we do not take any responsibility of the images that you upload</p>";
    ?>
    <!-- All the kinds of code you want to be outputed go here -->
    <img src="<?php echo "$urltoimages/$name" ?>">
    <br>Direct Link: <input name='direct' type='text' align='center' size='70' value='<?php echo "$urltoimages/$name" ?>'>
    <br> BB Code:<input name='bbcode1' type='text' align='center' size='70' value='[img=<?php echo "$urltoimages/$name" ?>]'>
    <br> BB Code: <input name='bbcode2' type='text' align='center' size='70' value='[img]<?php echo "$urltoimages/$name" ?>[/img]'>
    <!-- End of all HTML Code -->
    <?php
     
    }
    }
    if ($done <> "yes") { print "<p><b>Error:</b> Your image as not been uploaded becuase it is not a recognised image file. Please try again.</p>"; }
    }
    }
    ?>
    Yey Thanks 1 Problem It dosent take very big files
    How Do I make it have more

  8. #8
    Join Date
    Apr 2006
    Location
    Salford
    Posts
    2,108
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <?
    // Script Made By Ashley Cusack
    // CONFIG
    $siteurl "http://www.twoupload.com"//Must Include http:// and www. ending in where the images upload to with NO trailing slash
    $serverpath "images/"// The End of the part above
    $urltoimages "$siteurl"// Web address to where the images are accessible from.
    $maxsize "10000000"// Maximum size of the file people can upload
    $uniq uniqid("");
    // CONFIG END
    $mode $_GET['mode'];
    if (
    $mode == "") { $mode "form"; }
    if (
    $mode == "form") {
    echo 
    "<form enctype='multipart/form-data' method='post' action='uploader.php?mode=upload'>\n";
    echo 
    "Upload file: <input type='file' name='file'>\n";
    echo 
    "<br><input type='submit' name='Submit' value='Upload'>\n";
    $bytesize "1000";
    $kb $maxsize/$bytesize;
    echo 
    "<br>Maximum File Size: $kb Kilobytes <em>($maxsize Bytes)</em>";
    }
    if (
    $mode == "upload") {
    $file $_FILES['file']['name'];
    $name time() . substr($file, -4);
    // If you add your own file types don't forget to add an uppercase version.
    $allowedfiles[] = "gif";
    $allowedfiles[] = "jpg";
    $allowedfiles[] = "jpeg";
    $allowedfiles[] = "jfef";
    $allowedfiles[] = "jpe";
    $allowedfiles[] = "png";
    $allowedfiles[] = "GIF";
    $allowedfiles[] = "JPG";
    $allowedfiles[] = "JPEG";
    $allowedfiles[] = "JFEF";
    $allowedfiles[] = "JPE";
    $allowedfiles[] = "PNG";
    $allowedfiles[] = "PDF";
    $allowedfiles[] = "pdf";
    $allowedfiles[] = "PSD";
    $allowedfiles[] = "psd";
    $allowedfiles[] = "bmp";
    $allowedfiles[] = "BMP";
    $allowedfiles[] = "tif";
    $allowedfiles[] = "tiff";
    $allowedfiles[] = "TIF";
    $allowedfiles[] = "TIFF";
    $allowedfiles[] = "dib";
    $allowedfiles[] = "DIB";
    $allowedfiles[] = "sql";
    if(
    $_FILES['file']['size'] > $maxsize)
    {
    print 
    "File size is too big - please reduce file size and try again.";
    }
    else {
    $path "$serverpath/" $name;
    foreach(
    $allowedfiles as $allowedfile) {
     
    if (
    $done <> "yes") {
    if (
    file_exists($path)) {
    echo 
    "A file with this name already exists - please rename the file and reupload.";
    exit;
    }
    }
     
    if (
    substr($file, -3) == $allowedfile) {
    move_uploaded_file($_FILES['file']['tmp_name'], "$path");
    $done "yes";
    echo 
    "<p>Your image has been successfully uploaded to our server and can be accessed using the URL provided below.</p>";
    echo 
    "<p>Please Note we do not take any responsibility of the images that you upload</p>";
    ?>
    <!-- All the kinds of code you want to be outputed go here -->
    <img src="<?php echo "$urltoimages/$name?>">
    <br>Direct Link: <input name='direct' type='text' align='center' size='70' value='<?php echo "$urltoimages/$name?>'>
    <br> BB Code:<input name='bbcode1' type='text' align='center' size='70' value='[img=<?php echo "$urltoimages/$name?>]'>
    <br> BB Code: <input name='bbcode2' type='text' align='center' size='70' value='[img]<?php echo "$urltoimages/$name?>[/img]'>
    <!-- End of all HTML Code -->
    <?php
     
    }
    }
    if (
    $done <> "yes") { print "<p><b>Error:</b> Your image as not been uploaded becuase it is not a recognised image file. Please try again.</p>"; }
    }
    }
    ?>

  9. #9
    Join Date
    Jul 2007
    Location
    Swindon
    Posts
    990
    Tokens
    125

    Default

    Quote Originally Posted by Carbon View Post
    PHP Code:
    <?
    // Script Made By Ashley Cusack
    // CONFIG
    $siteurl "http://www.twoupload.com"//Must Include http:// and www. ending in where the images upload to with NO trailing slash
    $serverpath "images/"// The End of the part above
    $urltoimages "$siteurl"// Web address to where the images are accessible from.
    $maxsize "10000000"// Maximum size of the file people can upload
    $uniq uniqid("");
    // CONFIG END
    $mode $_GET['mode'];
    if (
    $mode == "") { $mode "form"; }
    if (
    $mode == "form") {
    echo 
    "<form enctype='multipart/form-data' method='post' action='uploader.php?mode=upload'>\n";
    echo 
    "Upload file: <input type='file' name='file'>\n";
    echo 
    "<br><input type='submit' name='Submit' value='Upload'>\n";
    $bytesize "1000";
    $kb $maxsize/$bytesize;
    echo 
    "<br>Maximum File Size: $kb Kilobytes <em>($maxsize Bytes)</em>";
    }
    if (
    $mode == "upload") {
    $file $_FILES['file']['name'];
    $name time() . substr($file, -4);
    // If you add your own file types don't forget to add an uppercase version.
    $allowedfiles[] = "gif";
    $allowedfiles[] = "jpg";
    $allowedfiles[] = "jpeg";
    $allowedfiles[] = "jfef";
    $allowedfiles[] = "jpe";
    $allowedfiles[] = "png";
    $allowedfiles[] = "GIF";
    $allowedfiles[] = "JPG";
    $allowedfiles[] = "JPEG";
    $allowedfiles[] = "JFEF";
    $allowedfiles[] = "JPE";
    $allowedfiles[] = "PNG";
    $allowedfiles[] = "PDF";
    $allowedfiles[] = "pdf";
    $allowedfiles[] = "PSD";
    $allowedfiles[] = "psd";
    $allowedfiles[] = "bmp";
    $allowedfiles[] = "BMP";
    $allowedfiles[] = "tif";
    $allowedfiles[] = "tiff";
    $allowedfiles[] = "TIF";
    $allowedfiles[] = "TIFF";
    $allowedfiles[] = "dib";
    $allowedfiles[] = "DIB";
    $allowedfiles[] = "sql";
    if(
    $_FILES['file']['size'] > $maxsize)
    {
    print 
    "File size is too big - please reduce file size and try again.";
    }
    else {
    $path "$serverpath/" $name;
    foreach(
    $allowedfiles as $allowedfile) {
     
    if (
    $done <> "yes") {
    if (
    file_exists($path)) {
    echo 
    "A file with this name already exists - please rename the file and reupload.";
    exit;
    }
    }
     
    if (
    substr($file, -3) == $allowedfile) {
    move_uploaded_file($_FILES['file']['tmp_name'], "$path");
    $done "yes";
    echo 
    "<p>Your image has been successfully uploaded to our server and can be accessed using the URL provided below.</p>";
    echo 
    "<p>Please Note we do not take any responsibility of the images that you upload</p>";
    ?>
    <!-- All the kinds of code you want to be outputed go here -->
    <img src="<?php echo "$urltoimages/$name?>">
    <br>Direct Link: <input name='direct' type='text' align='center' size='70' value='<?php echo "$urltoimages/$name?>'>
    <br> BB Code:<input name='bbcode1' type='text' align='center' size='70' value='[img=<?php echo "$urltoimages/$name?>]'>
    <br> BB Code: <input name='bbcode2' type='text' align='center' size='70' value='[img]<?php echo "$urltoimages/$name?>[/img]'>
    <!-- End of all HTML Code -->
    <?php
     
    }
    }
    if (
    $done <> "yes") { print "<p><b>Error:</b> Your image as not been uploaded becuase it is not a recognised image file. Please try again.</p>"; }
    }
    }
    ?>
    by changing this line;
    PHP Code:
     $maxsize "10000000"// Maximum size of the file people can upload 

  10. #10
    Join Date
    Apr 2006
    Posts
    1,463
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Eccentric View Post
    by changing this line;
    PHP Code:
     $maxsize "10000000"// Maximum size of the file people can upload 
    Thanks what do you think best size is

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •