Jump to content

usapphire

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Everything posted by usapphire

  1. Example; if a file is uploaded with a SPACE in it's name "My file.jpg", can the SPACE be replaced by an underscore? "My File.jpg" -> "My_File.jpg" ? The file name is kept in a table called "name".
  2. I don't know where the "edit" button is, but I also have another problem.. when someone "downloads" a file, the link only displays the first word, for example, if the file is called "My File.jpg", it will only display "My", and when downloaded, will be a file called "My".. so people won't be able to open it without changing the name.. Can this be fixed?
  3. Quick question How do I make it so that file types, example ".rar" are listed on a download page as "RAR", other than the default "application/octet-stream". I'm using mySQL to keep the data type. Thank you.
  4. Hello! Thank you for the very useful reply! There seems to be a problem though.. Where do I locate php.ini? I have a reseller account of a shared hosting, so would that mean I need to contact the server host to change the php.ini? Or should I make a new one in the /etc/ folder? Where do these go? I'm still new to php, so I don't exactly understand where to put these.. Thank you.
  5. Hello, and thank you for the reply! I don't exactly understand where to put this code, and where do I find the codes / tutorials on how to do the 4 points you listed above? If you want, can I post my full upload script here and have it edited to the way it should work? If this is asking too much, can you point me in the right direction (for tutorials, or something similar)? If you can do it for me, I'll repay you by giving you a free webhosting space.. as much as up to 50GB of server space, and whatever bandwidth..
  6. Hi.. my upload script works fine - the only thing is that it times out for no reason; it happens in this script too. Uploading files like ~5mb works perfectly, but going for files more than 10mb times out.. Thanks for helping, but this didn't fix it
  7. Hi.. still need help with this I emailed the original host seller, but they haven't replied.. maybe they don't know what's going on / what I mean.. Can anyone help? :'(
  8. It's a reseller hosting where I can make shared accounts.. Does this count?
  9. Hi again - just like to say thank you for previous help. Just a quick one today, I'm quite sure it's just me doing something completely wrong. After uploading my previous upload/download script and getting it to work (refer to my other topics; Upload & Download Script and Error in uploading file), it ended up not working completely right. I had someone try to upload a 10 mb file, and it came with an error.. I realized this must have something to do with the max upload allowed, and so, in my .htaccess file, I set it to; php_value upload_max_filesize 1000M Just to see if it'll work. Still no luck. After trying to upload a 10 mb file, I think it "times out" within 3-4 minutes. It refreshes the page, where it's suppose to display the "FILE HAS BEEN UPLOADED SUCCESSFULLY", but displays nothing - nor is the file uploaded to the directory, listed on the download list, or even added to the MySQL. Does anyone know what might be the problem? Thank you (I can post the site for those who want to try it out, but it contains 16+ content (it's an upload site for aarinfantasy.com).
  10. No, still doesn't work.. Thank you for trying to help, but I'll just remove it - if you happen to find the answer later, please let me know. Thank you. :'(
  11. It disables it, but still doesn't submit.. This is what's been happening..
  12. Sorry, should this go <input name="upload" type="Submit" id="upload" value="Upload" onclick="showProgress();" onclick="this.disabled=true;" HERE>? I don't understand.
  13. Well ok.. thanks for the help. I'll try finding the answer somewhere..
  14. It's an upload site.. if they click it more than once, it'll restart the upload? I allowed files up to 100mb to be uploaded, so I don't think people who want to upload a file 100mb want to keep clicking it if they think it'll make it go fast.. :-\
  15. Changed, and it didn't seem to make a difference.. However, I found something that made the error. <script> function submitonce(theform){ if (document.all||document.getElementById){ for (i=0;i<theform.length;i++){ var tempobj=theform.elements[i] if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset") tempobj.disabled=true } } } </script> This code is located in the header.php file between <HEAD></HEAD>. It's to prevent people from clicking "Upload" (submit button) more than once.. If I take it off, it works - but now I'm left with the Upload button still able to be clicked. Does anyone have another code that may allow it to work? Or know how I can change this one so it can work? Thank you EDIT: Just a note, it has actually worked in the past with the code!! Thanks again.
  16. It's taken me over 5 hours just to get this one put together. I don't see a reason why it shouldn't work.. :'( If I can't find an explanation, I'll use yours.. Thank you for the post.
  17. http://www.hotscripts.com/PHP/Scripts_and_Programs/E-Commerce/Store_Locators/index.html This place seems to have loads of the Store scripts, it's just the matter of finding which one best suits you! There's a few free ones there too!
  18. I'm sorry, I'm not very PHP-logic.. Maybe someone else can help? Sorry..
  19. Found one for 45.99$.. It seems to be what you're looking for; http://www.php4script.com/store-locator-script/ There's also a tutorial for something similar, but it uses PHP and AJAX; http://www.scriptygoddess.com/archives/2007/02/13/store-locator-using-php-and-ajax/ Goodluck!
  20. This may sound silly.. but is the folder CHMOD to 777? Since it's moving a file into the folder, you'll need to CHMOD it for access...
  21. Yes, it does.. and it's CHMOD to 777 Thanks for trying to help
  22. Hey everyone Thanks previously for your help! I have a quick problem, which I'm sure is just something very silly.. I made an upload script thanks to PHP Freaks and the person who replied to my previous forum, but after finally finishing it.. there seemed to be an error. Okay, so this is what I did: 1. Script worked fine. Integrated into the site layout with no problem. 2. Made "categories" within the site.. So this means that there is more than 1 upload/download page.* 3. Made the MySQL databases to hold data for the other categories. 4. Uploaded the new pages, and CHMOD the upload folder to 777. 5. Tried it out - doesn't work anymore. * The different categories are on different pages. For example; category1.php, category2.php, etc. Here is the code I'm using. Upload form / display download files page. <?php include("header.php"); ?> <div align="center"><img src="images/index_category1.jpg" border="0"></div><br> <?php $uploadDir = 'category1/upload/'; if(isset($_POST['upload'])) { $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; // get the file extension first $ext = substr(strrchr($fileName, "."), 1); // make the random file name $randName = md5(rand() * time()); // and now we have the unique file name for the upload file $filePath = $uploadDir . $randName . '.' . $ext; $result = move_uploaded_file($tmpName, $filePath); if (!$result) { echo "There was an error uploading the file. Click the back button and try again."; exit; } include 'category1/config.php'; include 'category1/opendb.php'; if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); $filePath = addslashes($filePath); } $query = "INSERT INTO upload2 (name, size, type, path ) ". "VALUES ('$fileName', '$fileSize', '$fileType', '$filePath')"; mysql_query($query) or die('Error, query failed : ' . mysql_error()); include 'category1/closedb.php'; echo "<div align=center><font color=red><b>YOUR FILE HAS BEEN UPLOADED!</b><br></div></font>The Direct link is found on the right of your file name. Can't see your file? New uploaded files are placed on the bottom of the list, so scroll down. To copy the link, Right-Click on the <b>DOWNLOAD FILE</b> text, and select <b>Copy Link Location</b> or <b>Copy Shortcut</b>. Thank you for using our services!</font><br>"; } ?> <script> function showProgress(){document.getElementById('progressRow').style.display = 'inline'; } </script> <div align="center"> <span id="progressRow" style="display:none;"><table border=0 cellpadding=10 cellspacing=0 class=forText width=90%><tr><td valign=middle bgcolor=#ececec><div align=center><b><font color="black"><div align="center">Your file is being uploaded. Please wait <img src="images/dot.gif"></div></b></font></tr></td></table></span></div> <form method="post" enctype="multipart/form-data" onSubmit="submitonce(this)"> <table border="0" cellpadding="0" cellspacing="5" class="forText"> <tr> <td><img src="images/index_52.jpg"></td><td><input name="userfile" type="file" id="userfile" size="35" class="forText"> </td> <td><input name="upload" type="Submit" id="upload" value="Upload" onclick="showProgress();" onclick="this.disabled=true;"></td> </tr> </table> <div align="center"> <table border=0 cellpadding=10 cellspacing=0 class=forText width=90%><tr><td valign=middle bgcolor=#ececec><div align=center>-DISCLAIMER-</tr></td></table> </div> </form><br><br> <?php include("category1_download.php"); ?> <?php include("footer.php"); ?> The Download page (script for include) <?php error_reporting(E_ALL); if(isset($_GET['id'])) { include 'category1/config.php'; include 'category1/opendb.php'; $id = $_GET['id']; $query = "SELECT name, type, size, path FROM upload2 WHERE id = '$id'"; $result = mysql_query($query) or die('Error, query failed'); list($name, $type, $size, $filePath) = mysql_fetch_array($result); header("Content-Disposition: attachment; filename=$name"); header("Content-length: $size"); header("Content-type: $type"); readfile($filePath); include 'category1/closedb.php'; exit; } ?> <?php include 'category1/config.php'; include 'category1/opendb.php'; $query = "SELECT id, name FROM upload2"; $result = mysql_query($query) or die('Error, query failed'); if(mysql_num_rows($result) == 0) { echo "<div align=center><table border=0 cellpadding=5 cellspacing=0 class=forText width=90%><tr><td valign=middle bgcolor=#ececec><div align=center>There are no files uploaded in this directory. <b>Be the first!</b></tr></td></table></div>"; } else { while(list($id, $name) = mysql_fetch_array($result)) { ?> <table border=0 cellpadding=0 cellspacing=5 class=forText width=100%><tr><td valign=middle bgcolor=#ececec width=75><div align=center> <img src=images/category1.jpg></div></td><td valign=middle bgcolor=#ececec><div align=center><?=$name;?></div></td><td valign=middle bgcolor=#ececec width=100><div align=center><a href="category1_download.php?id=<?=$id;?>">DOWNLOAD FILE</a></div></tr></td></table> <?php } } include 'category1/closedb.php'; ?> The error that comes up is "There was an error uploading the file. Click the back button and try again." ???
  23. Found one.. Thanks again for your help! For everyone else who wants to know: <? $file_dir="FILE_DIRECTORY"; $dir=opendir($file_dir); while ($file=readdir($dir)) { if ($file != "." && $file != "..") { echo "<a href=".$file_dir."/".$file." target=_blank>".$file."</a>"; echo "<br>"; } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.