+ Reply to Thread
Results 1 to 2 of 2

Thread: Different file modes when upload files with different types in php

  1. #1
    fomalhaut is offline x10Hosting Member fomalhaut is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    South of France near Arles
    Posts
    91

    Different file modes when upload files with different types in php

    Hello.

    In PHP, I upload certain files through a html form and then I move them in ad-hoc directory.
    That's works fine (the files stand finally where I wanted), but on x10 they have not the same file mode:

    I upload a file with .MUS extension ==> mode was 0644 (that's I want)
    I upload a file with .html extension ==> mode was 0600 (I'ld like to have 0644).

    PHP Code:
      $uploadfile $uploaddir basename($_FILES['fileNameAIns']['name']);
      
    $Tmsg "Cr&eacute;ation du CROA n&deg;<b>" $noCROAAIns "</b> effectu&eacute;e";
      if (
    rename($_FILES['fileNameAIns']['tmp_name'], $renamedfile)) {
        
    $Tmsg $Tmsg "<br />et fichier mis en place";    
      } 
    On my home server, the twice have mode 0644.

    May I add a chmod to force the 0644 in the script ? Or how do I do ?

    Thanks for your help.


    fomalhaut.x10.com : Compte Rendus d'Observations Astronomiques

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Different file modes when upload files with different types in php

    Quote Originally Posted by fomalhaut View Post
    May I add a chmod to force the 0644 in the script ? Or how do I do ?
    Yes, using PHP's chmod function.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. I can't upload files into file manager through ftp.
    By Tourniqu3t in forum Free Hosting
    Replies: 6
    Last Post: 09-05-2010, 12:57 AM
  2. can not file menager anyhwre. how can i upload my files
    By amitdhiman in forum Free Hosting
    Replies: 2
    Last Post: 10-12-2009, 02:08 AM
  3. Types of files
    By Wizet in forum Off Topic
    Replies: 10
    Last Post: 08-08-2008, 08:43 AM
  4. file types...?
    By freestuff in forum Free Hosting
    Replies: 3
    Last Post: 05-11-2006, 04:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers