Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Pages: [1]
Print
Topic: Also Not Allowed?  (Read 428 times)
« on: February 18, 2008, 09:02:40 PM »
Atrain Offline
Newbie

View Profile WWW
*
Posts: 34



Okay i want people to be able to upload some minor files to my site. I wrote a simple php uploader.
I made an html file upload.html and wrote it like this:
<html>
<body>
<form enctype="multipart/form-data" action="uploader.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="2000000000000000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
</body>
</html>

Then a php file uploader.php and wrote it like this:
<?php
  {
// Where the file is going to be placed
$target_path = "uploads/";

/* Add the original filename to our target path. 
Result is "uploads/filename.extension" */
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
$_FILES['uploadedfile']['tmp_name']; 
  {
$target_path = "uploads/";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
    echo "The file ".  basename( $_FILES['uploadedfile']['name']).
    " has been uploaded";
} else{
    echo "There was an error uploading the file, please try again!";
}
  ?>

And when i upload a simple picture file just to test it, it brings me to a balnk page without the error message or confirmatino message, and the file isnt uploaded to /uploads. Is this because this isnt allowed? Or am i doing something wron?
Report to moderator   Logged

 
« Reply #1 on: February 19, 2008, 03:06:10 AM »
Alex Melen Offline
President / Founder
Administrator
Addict

View Profile WWW
*****
Posts: 1,999



File uploading scripts are not allowed on free hosting. Please use ftp or our own file manager to upload files.
Report to moderator   Logged

« Reply #2 on: February 19, 2008, 08:18:42 PM »
Atrain Offline
Newbie

View Profile WWW
*
Posts: 34



Okay thanks again
Report to moderator   Logged
« Reply #3 on: February 21, 2008, 04:41:38 PM »
terceslil Offline
Jr. Member

View Profile WWW
**
Posts: 61



If you want to create a page that allows users to upload files to you, here is the solution:

Check out http://www.uccs.edu/~formmail/

If you are familiar with code, you can use his script in your page to send an upload to your email.  You can use this to allow your users to send attachments to your email. 

I have used it and it works.....  until the university takes it down.

Good luck.
Report to moderator   Logged

Designing cheap web sites to get me through school.
My site: www.geauxwebdesigns.com
One of my designs: www.geauxgraphics.com
Yes, women play TACKLE football: www.brfuel.com
My newest design: www.womenplayfootball.com
 
Pages: [1]
Print
Jump to:  

Powered by SMF | SMF © 2006-2008, Simple Machines LLC