Php Upload

free web hosting
Free Web Hosting, No Ads > Have your say > General Talk

Php Upload

AlternativeNick
before i begin, i dont really know where to post this, so please move if neccessary

OK, im trying to make a php script that will upload something to whatever webserver it is im hosted on (currently ripway, trap17 soon) i was just wondering if trap17 will work with it?

im not very good with php yet, so im not sure what could be going wrong :S

anyways, what i have so far is this

CODE

<?php
if ( move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'],
       "../uploads/{$_FILES['uploadFile'] ['name']}")  )
      {  print '<p> The file has been successfully uploaded </p>';
       }
else
      {
        switch ($_FILES['uploadFile'] ['error'])
         {  case 1:
                   print '<p> The file is bigger than this PHP installation allows</p>';
                   break;
            case 2:
                   print '<p> The file is bigger than this form allows</p>';
                   break;
            case 3:
                   print '<p> Only part of the file was uploaded</p>';
                   break;
            case 4:
                   print '<p> No file was uploaded</p>';
                   break;
         }
       }
?>


it doesnt throw any errors, but it also doesnt upload anything that i can tell.

help plz?

 

 

 


Reply

myrmidon

Now you have specified the ../uploads directory for upload, does that directory exists ? Also check in php.ini that you have granted the upload and in which dir (on linux sys , does php group has access to that dir)


if ( move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'],
"../uploads/{$_FILES['uploadFile'] ['name']}") )
{ print '<p> The file has been successfully uploaded </p>';
}

Reply

AlternativeNick
yes the directory exists and it still doesnt upload it, however it is just a free host that im being hosted by, so i am unable to access php.ini or any of that.

also, does trap17 allow php uploads like that to my hosting? i.e. if i put an upload on my Trap17 site, will i be able to have users of my site upload into my space on the server?

finally, what did you post this for? im not quite clear on that

QUOTE(myrmidon)

if ( move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'],
"../uploads/{$_FILES['uploadFile'] ['name']}") )
{ print '<p> The file has been successfully uploaded </p>';
}

Reply

uiop
I'm a PHP noob so I can't help much on this topic other than to refer you to http://www.tizag.com/phpT/fileupload.php. I always use Tizag to help me learn web-hosting stuff.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : php upload

  1. Upload - (7)
  2. music upload? - (15)
    pls tell me ... do i can upload music file 100 mb? thank u...
  3. Pafiledb - Can't upload files larger than 2mb. Upload limit? - (7)
    Hi, I have mxbb, phpbb with pafiledb for files ul/dl. I've noticed that when I trie to upload
    files larger than 2mb nothing happens. Like I haven't ul-aded them. I've tried both administrator
    and user ul. I've raised pafiledb settings to 5mb. Still nothing. /sad.gif' border='0'
    style='vertical-align:middle' alt='sad.gif' /> Is there some kind of upload (download) limit
    on freenukehosting that limits the size of the file? Please help me. Thanx Rade...
  4. how fast ? download/upload from your free hosting? - (7)
    yesterday i upload my website only 1~5k/s. and download only 5k/s too. but today i try it agin,
    there is 15k/s. what about you ?...
  5. Can't upload - (4)
    Why can't I upload on my site? When I try to do it, it works for about 3 minutes then it just stops.
    I've tryed uploding with 3 diffrent programs and it was the same thing. /sad.gif' border='0'
    style='vertical-align:middle' alt='sad.gif' /> What can I do?...
  6. AVATAR Upload error ! - (7)
    Warning: copy(./images/avatars/4977300194213572f15fa1.jpg): failed to open stream: Permission denied
    in /home/freenuke/public_html/forums/includes/usercp_avatar.php on line 227 Warning: Cannot
    modify header information - headers already sent by (output started at
    /home/freenuke/public_html/forums/includes/usercp_avatar.php:227) in
    /home/freenuke/public_html/forums/includes/page_header.php on line 477 Warning: Cannot modify
    header information - headers already sent by (output started at
    /home/freenuke/public_html/forums/includes/usercp_avatar.php:227) in /home/freen...
  7. how much can i upload? - (15)
    i basically need free nuke hosting so that i can upload .wmv files. i have searched endlessly to
    find an appropriate web space provider but no luck. most of my files are approx 50 mb. i don't want
    to keep them there permanently, only for a week or so for approx 5 files which are 50 mb average.
    kindly guide me as to whether nuke hosting is for me, and if not, then please give help. thank
    you. taha...
  8. how to upload a file? - (4)
    How to use file manager in cpanel to upload a file from another web source. As my college does not
    allow ftp acess. I tried once with a zip file it shows the size as one kb. is ther any other
    option......
  9. Is hotlinking allowed? And whats the filesize upload limit? - (5)
    Is hotlinking fromthe site allowed? And whats the filesize upload limit? I like to put music in the
    background, so a filesize limit of 5 or higher would be great. Also'd be hosting some replay files
    for Warcraft 3, cuz my sites gonna be mostly about warcraft and stuff :? ....
  10. can someone upload a phpbb skin for me? - (45)
    Ok im asking for someone to upload 1 for me becuase i cant install for example a ftp program.
    beecuase my computer will crash. nd it only takes like seconds to uplaod it so thats why im asking.
    i would really aprecviate it if someone could uplaod a skin for me. just tell me here or pm me....
  11. I can't upload mysite. - (6)
    QUOTE COMMAND:> PASV  227 Entering Passive Mode (204,157,10,223,65,109) COMMAND:> REST 0
     350 Restarting at 0 COMMAND:> STOR mambo_Laithai_v.1.0.zip STATUS:>   Connecting FTP data socket
    204.157.10.223:16749...  553-Can't open that file: Permission denied  553 Rename/move failure:
    No such file or directory ERROR:>    Access denied. why i can't upload and don't see any file on
    server but i can login to ftp mysite http://ugclub.xerox-hosting.com check plz....
  12. UPLOAD SCRIPT (.php) - (2)
    Upload script CODE <? if ($mode == "upload") { function
    getPath() { global $SCRIPT_FILENAME; $tmp =
    split("[/]",$SCRIPT_FILENAME); $tmp = $tmp[count($tmp)-1];
    $tmp = str_replace($tmp,"",$SCRIPT_FILENAME); return $tmp; } print
    "Text coming with file : $myText<br/>n"; print "<hr/>n"; print
    "Temporary Remote Path : " .
    $HTTP_POST_FILES["myFiles"]["tmp_name"][0].&#...
  13. Upload Failed - (10)
    Uhm.. okay.. I just got hosting, and its not working for me. everytime I try to upload things it
    says "upload failed" whats wrong?...
  14. Can Create Folders or even upload things!! - (5)
    hello admin.. sorry if i asking some qns ppl have asked.. /laugh.gif' border='0'
    style='vertical-align:middle' alt='laugh.gif' /> i have juz got my new account re approve and
    be on the new hosting.. i have try to upload things since i got it but cant.. either the ftp or
    the cpanel both i tried n nothing seems to be able to upload or even create new folders in it.. the
    ftp prog i using is turbo ftp.. this ftp prog has been fairly ok to use in other occassion.. except
    this.. maybe u can check out n tell me y.. 10s PS: i find it oso weird this time why there is ...
  15. WEBSITE UPLOAD PROBLEMS: NO DIRECTORIES - (31)
    Hey guys, anyone! Admin, or anyone else... I am having trouble uploading from Dreamweaver (FTP)
    I have UnitedVA.xerox-hosting.com in the FTP server I have my username and pass When i click
    TEST it says that it connected, but i cant seem to "put" or "sync" my index.html or home.html or
    aboutus.html etc etc... it says ERROR for each one... Can some one post something that could help
    me get this going, i'm really anxious to use FNH this is really cool... Thanks in advance for
    your response...
  16. I can't upload via FTP client - (1)
    I used the first main FTP account in the list in my host CP (my free hosting requested in this
    forum). I can access, but can't upload any thing to my host....
  17. PHP Upload script - (17)
    Does anyone know how i could use php to create a page where i can upload a file to a pre-defined
    folder on my accout?...
  18. How long to upload a site? - (4)
    Not that I've requested an account yet but I thought I'd ask -- is there a time limit between when
    an account is activated and when you expect the site to go live? If it's not uploaded in a
    reasonable amount of time is it deleted even if that member is active on the forums? Just thought
    I'd check as some free sites have specific rules regarding these things. BTW, I'm mightily
    impressed with what I've seen so far. I've been checking out various free hosts and your community
    is by far the most professional and friendliest I've seen....



Looking for php, upload

Searching Video's for php, upload
advertisement



Php Upload



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE