Solved

how do i create a file with permissions set the way i want them.

Posted on 2006-11-15
3
225 Views
Last Modified: 2006-11-18
i'm using fopen to create and open a file. it creates the file however it's permissions are 0644. of course the drag is i can't edit the file in my ftp program nor change the permissions because i don't have permission.

i can't use chmod on my server. is there any way to set the permissions when you create the file??

'create file x and set the permissions to 0666' or something like that??

thanks for looking this over.
tony miceli
0
Comment
Question by:tjazzvibe
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
VoteyDisciple earned 250 total points
ID: 17952110
If PHP can create the file surely it can chmod it too?  http://us2.php.net/chmod

Alterantively, PHP will let you set the umask the same as you could on a server: http://us2.php.net/manual/en/function.umask.php

Set the umask you want first and then create the file; it should come out fine.
0
 

Author Comment

by:tjazzvibe
ID: 17952606
umask did the trick. thanks!

i can't set anything to 777, i can do 666 but 0's don't get me anywhere. ones do 666.

i don't know a ton about all this, i'm just learning. maybe i'm doing something wrong. but for now this works.

thanks for your help
tony
0
 

Author Comment

by:tjazzvibe
ID: 17952613
ps i can't use chmod at all with my server.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to send multiple emails at the same time in PHP 12 57
designing in object programming 12 75
google map tracking website 5 22
Dynamic varibles 5 32
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now