Thread: Upload File Php

Page 2 of 2 First 12
  • Jump to page:
    #16
  1. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,472
    Rep Power
    653
    Consider the OP with respect to the discussion.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  2. #17
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2016
    Location
    Cheshire, UK
    Posts
    90
    Rep Power
    72
    Oh come on! Unless it's something that he can copy/paste he doesn't even read the replies.
  4. #18
  5. Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2006
    Posts
    2,682
    Rep Power
    1841
    Originally Posted by Sepodati
    You ****ers are making a simple point complicated. I said draw.
    *goes for my gun ...*
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc
  6. #19
  7. Lord of the Dance
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Oct 2003
    Posts
    4,184
    Rep Power
    2012
    Originally Posted by Sepodati
    You ****ers are making a simple point complicated. I said draw.
    You don't use you left or right hand to draw?

    Well, might be you better like to use your feet!
  8. #20
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2017
    Posts
    845
    Rep Power
    0
    Originally Posted by kicken
    The difference is far too minor to be covered by any best practice rules. Which one do you like best? Use that.
    Nevertheless, I still want your opinion in terms of which version is good for cpu usage or php interpreting speed or ... etc. even though it is too minor. Because, if I learn the best practice then on a larger file, where it won;t be too minor but major, then I'll use the best practice.
  10. #21
  11. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2017
    Posts
    845
    Rep Power
    0
    Originally Posted by gw1500se
    Six of one, half dozen of the other.
    There is no difference. Lol!
  12. #22
  13. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2017
    Posts
    845
    Rep Power
    0
    Originally Posted by Sepodati
    You moved one block of code 6 lines or so down. Who ****ing cares? Why do you think this is going to make a difference? It's all the same code, unless I missed a change somewhere.

    Code:
                //Make Directory under $user in 'uploads/videos/id_verifications' Folder. 
                if(!is_dir("$directory_path"  . "$user")) 
                { 
                    $mode = "0777"; 
                    mkdir("$directory_path" . "$user", $mode, TRUE); 
                }
    Check what I replied to Kicken, my friend.
    I'm back to haunt you again with tonnes of questions.
  14. #23
  15. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2017
    Posts
    845
    Rep Power
    0
    Originally Posted by Sepodati
    When you draw a circle, is it best to draw clockwise or counterclockwise?
    Good example. It says it all!
    Anyway, one can be v1 and the other v2 to be daft! Lol!
  16. #24
  17. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2017
    Posts
    845
    Rep Power
    0
    Originally Posted by gw1500se
    Wouldn't that depend in if you were right or left handed?
    Good. the conversation is taking a direction somewhere by you guys with each other at my absence for about a wk. I'm glad you guys are "php socialising" here.
    Bad news, my 3 domains expired and I tried renewing now but gone to redemption period. Not paying any extra. When they go in the public domain, will try quickly registering them again. They were $billion names.
  18. #25
  19. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2017
    Posts
    845
    Rep Power
    0
    Originally Posted by Sepodati
    You ****ers are making a simple point complicated. I said draw.
    Ha! Ha! Ha! They complicated things! They actually understand your point. It's just they're in the mood to go a little off track.
    Nevertheless, I like it. All my php guardian angels are getting together and warming up on Sepo's simple example.
    Anyway, I have more similar questions regarding best practice. Opening another thread in a day or 2. Look-out for it, fellas or should I say "fellows" ? Lol!
  20. #26
  21. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2018
    Location
    Pakistan
    Posts
    38
    Rep Power
    1
    <?php
    if(isset($_FILES['image'])){
    $errors= array();
    $file_name = $_FILES['image']['name'];
    $file_size =$_FILES['image']['size'];
    $file_tmp =$_FILES['image']['tmp_name'];
    $file_type=$_FILES['image']['type'];
    $file_ext=strtolower(end(explode('.',$_FILES['image']['name'])));

    $expensions= array("jpeg","jpg","png");

    if(in_array($file_ext,$expensions)=== false){
    $errors[]="extension not allowed, please choose a JPEG or PNG file.";
    }

    if($file_size > 2097152){
    $errors[]='File size must be excately 2 MB';
    }

    if(empty($errors)==true){
    move_uploaded_file($file_tmp,"images/".$file_name);
    echo "Success";
    }else{
    print_r($errors);
    }
    }
    ?>

    Comments on this post

    • DSmabismad disagrees : nothing to do with the question asked or problem in the thread
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo