Uploader for server (local based server)

This is guide mostly for website tools and code, for example CMS or registration scripts.
There can also be tools.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

Uploader for server (local based server)

Postby jordylad42 on Sat Feb 27, 2010 10:22 pm

///File uploader for website\\\
You can easily imliment this into a cms such as dynasty this is a basic code with no upload limit so be aware of that before you put into your website.

///DOWNLOAD\\\
http://www.mediafire.com/file/mnmtozxu0 ... module.rar

///CODE\\\

upload.php
  1. <?php
  2.  
  3. //properties of uploader\\
  4. $name = $_FILES["myfile"] ["name"];
  5. $type = $_FILES["myfile"] ["type"];
  6. $size = $_FILES["myfile"] ["size"];
  7. $temp = $_FILES["myfile"] ["tmp_name"];
  8. $error = $_FILES["myfile"] ["error"];
  9.  
  10. if ($error > 0)
  11. die("Error File could not be uploaded  Code $error."); 
  12.  else
  13. {
  14. if ($type = "video/avi" || $size > 50000000) //default blocks file type .avi and file upload limit 40 mb
  15. {
  16. die ("file format or size error");
  17. }
  18. else
  19. {
  20.  move_uploaded_file($temp,"/Uploaded".$name);
  21.  echo "File upload Completed";
  22.  
  23. }
  24. ?>


Index.php
  1. <html>
  2. <center><h1>Upload a file...</h1>
  3. <form action='upload.php' method='post' enctype='multipart/form-data'>
  4. <input type='file' name='myfile'><p>
  5. <input type='submit' name='Upload'>
  6.  
  7. </form></center>
  8.  
  9.  
  10. </html>


just thought that i would make a post because ive been busy for a while and havent posted enjoy. :)
Last edited by jordylad42 on Sun Feb 28, 2010 4:23 pm, edited 1 time in total.
jordylad42
Pomic
Pomic
 
Posts: 78
Joined: Tue Dec 29, 2009 5:31 pm

Re: Uploader for server (local based server)

Postby Choseal on Sat Feb 27, 2010 11:49 pm

Shouldn't you use Javascript when you are uploading really large files, because off the time-out thingy? :P

Besides that, good job, thanks for sharing. :3
Choseal
Electric Ghost
Electric Ghost
 
Posts: 837
Joined: Fri Jan 09, 2009 6:40 pm

Re: Uploader for server (local based server)

Postby jordylad42 on Sun Feb 28, 2010 12:09 pm

And yea but its not realy for uploading large files its probably mainly going to be used as a picture uploader. ;)
jordylad42
Pomic
Pomic
 
Posts: 78
Joined: Tue Dec 29, 2009 5:31 pm

Re: Uploader for server (local based server)

Postby Choseal on Sun Feb 28, 2010 3:35 pm

Then maybe it would be usefull for the others if you put an upload limiter on it, which people can change, just for safety.
Choseal
Electric Ghost
Electric Ghost
 
Posts: 837
Joined: Fri Jan 09, 2009 6:40 pm

Re: Uploader for server (local based server)

Postby jordylad42 on Sun Feb 28, 2010 4:10 pm

ok ill change the code ;) edited now only allows 40 mb upload
jordylad42
Pomic
Pomic
 
Posts: 78
Joined: Tue Dec 29, 2009 5:31 pm

Re: Uploader for server (local based server)

Postby Choseal on Sun Feb 28, 2010 5:53 pm

Cool, looking forward to see more of your work, you are really bringing this section alive, haha. :)
Choseal
Electric Ghost
Electric Ghost
 
Posts: 837
Joined: Fri Jan 09, 2009 6:40 pm

Re: Uploader for server (local based server)

Postby xPrend on Sun Feb 28, 2010 7:57 pm

jordylad42 wrote:ok ill change the code ;) edited now only allows 40 mb upload

No way xD php.ini will block that max upload size by default is 10 mb or something you gotta change php.ini befor you can do that.
You better use js to upload things becaus timeout problems + php.ini isn't editable for everyone.

Anyway nice another releas!
User avatar
xPrend
Antares
Antares
 
Posts: 346
Joined: Fri Jul 17, 2009 9:22 am

Re: Uploader for server (local based server)

Postby jordylad42 on Sun Feb 28, 2010 8:40 pm

yeah i understand that but yeah its pretty helpful for beginners i think and for servers quite helpful if you want a gallery page i know i used it and i had no problems editing my php.ini file but i understand that may be a problem grrrrrr dam timeouts.
jordylad42
Pomic
Pomic
 
Posts: 78
Joined: Tue Dec 29, 2009 5:31 pm

Re: Uploader for server (local based server)

Postby Choseal on Sun Feb 28, 2010 9:09 pm

Off-topic: OsGallery, it's a really good gallery system.
Choseal
Electric Ghost
Electric Ghost
 
Posts: 837
Joined: Fri Jan 09, 2009 6:40 pm

Re: Uploader for server (local based server)

Postby jordylad42 on Sun Feb 28, 2010 9:39 pm

ok lol i sortta knew that ;) thinking more along the lines of lightbox that worked pretty well for me.
jordylad42
Pomic
Pomic
 
Posts: 78
Joined: Tue Dec 29, 2009 5:31 pm


Return to PHP / Web Guides, Scripts and tools.

Who is online

Users browsing this forum: No registered users and 1 guest