Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




I Can Upload Files Anywhere Except My Remote Root Folder


Im working on a project with PHP that allows users to upload pictures to my server and then reference them. After going through some uploading tutorials I have the uploading part working Except! I cant upload folders to my remote root folder. I need to allow the users to upload somewhere inside the root folder so they can reference the pictures in code after.

Just to clarify the uploading works perfectly if I put the uploads folder anywhere on my computer except the sites remote root folder (or anywhere inside the root folder)
I also beleive I am giving the folder all of the proper permissions because I am giving the uploads folder in my root directory (the one that doesnt work) the same permissions as the one outside the root (the one that works) Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Root Of Folder App Files
While I know putting a app into a folder was chiseled out of fine
scottish granite and carried upto the top of ben nevis by php newbies
many years ago - I dont think a folder is the best way to do it .

The fact a script is in a folder means certain instant problems if you
want to do certain things with .

Assuming a script doesnt have index.php and all the script files have a
filename prefix like phpgb_ then theres no chance of them clashing with
anything else and theres no real reason to continue using a folder for
the main script files .

While the script will have a app folder for various things - does it
make any sense not to use the root because of a single solitary file
called index.php .

phpgb_index.php is what I use and the method hasnt brought up a single
problem of any shape or description .

Gas lighting was once what everybody thought was the best way of doing
it until that darn new fangled electricity came along .

The Root Folder
I've a web site in the address http://mySite.com
in the root, I've a file index.html

I've some subfiolders insid root/sub1/sub2

I like to add an html file (or php) index.html that call the index.html of
the root (in order to protect)
Now I've created 2 different index.html because I use relative path to
design the root (../index.html and ../../index.html)

I like to have the same file in all folders,but I don't know how to call the
root folder.

Drag Files From One Folder To Another Folder (copy) .. Possible?
Is it possible to write codings PHP or Javascript.. GUI representation
of File handling (ie. Drag files from one folder to another folder (copy)
like our windows).. pls give me some reference codings like this..

Creating / Removing A Remote Folder
I thought there had to be an easy way to do file functions relating to folders, eg: create/modify/delete. Is there? Or am I in for some sort of craziness?

Access To Mp3 Files Below Web Root
I want to place some mp3 files below the web root directory to keep people from accessing these files. however i want certain php scripts to be able to use them (ie for a flash movie that plays mp3 files)whats the best way to accomplish this?

Accessing Files Outside Of The Web Root
Anyone got any pointers for a script and/or advice for accessing files that are outwith the root directory. I am using Apache on WIN2K Server (a box which is also running IIS on port 81).

I want user to be able to select a file and have a script verify their security clearance level (although I have this part worked out already) and then to supply a relative url from the web page they are on - out of the web root - to the file in question.

I have been toying with the 'realpath' function but to no avail thus far. I have tried using the path:

../../../files/{filename}
where the path to the web root (from the page in question) is
../../../

on my notebook (running WINXP Pro and same version Apache and PHP this works fine) but on the production server it cannot find the path outwith the server root.

PHP Files Only Run In Root Directory?
I've installed a php forum script under a directory named 'forum', the script ran with no problems untill about a week ago, but now I get the following error: 'You don't have permission to access /forum/index.php on this server.'

Its has nothing to do with CMOD, I've tried that. Worst still it's not just the forum it's any PHP file thats under a directory. The thing is, I can run a PHP file from the root directory, but for some reason can't run the same file under another directory.

eg www.mywebsite/testfile.php --- will work fine www.mywebsite/newdirectory/testfile.php --- causes permission error

Could it be a .htaccess problem? Heres my error log report: Options ExecCGI is off in this directory: /home/mywebsite/public_html/forum/index.php P.S The forum script dosn't use CGI?

.tmp Files Being Placed In The Root Directory By The 100's, Want It To Stop
Hi folks, I have a bit of a problem, perhaps one of you knows what is going on.

According to the sys admin at my ISP, something from my site (which is entirely php) is saving 100's of tiny files with the extension .tmp into the root directory on the server where my site is located.

He doesn't know very much about PHP and neither do I (this is the first site I've ever produced using it) so neither of us knows what could be causing it, there is one other site hosted on that server that is running PHP and it is doing the same thing, although the lion's share of temporary files are coming from my site.

I have a copy of the php.ini file that he emailed to me this morning, if it would help to post it please let me know and I will do so. We are not sure what is going on, but we would like to know if there is some way to make it stop (or at the very least, to get these files to destroy themselves once they're no longer usefull)

Also: I would like to thank SilkySmooth for his mail script, I used it awhile back and it got the job done. Thanks so much!

How To Detect Number Of Files And Files' Name In A Folder?
I have a server built in window + apche. I am trying to make a photo album, but I don't know what is the code for detecting the number of files in a server folder and the files' name~.

Executing System Files Deep In The Root Tree
I am running on an linux box with ensim webppliance. Ensim is really cool because it has a hold folder of files that perform different tasks that you would normally do from the interface. My problem is, i don't want to do them by hand, i want one of my PHP scripts to executre them and return the results. Now, there are a few problems, like you have to be root to run these scripts, cus they are in /usr/local/bin. I tried shell_exec, and exec, but I can't seem to figure out how to do this correctly.

Upload Folder
I have this code:

$uploaddir = dirname($_SERVER['SCRIPT_FILENAME']) ."/Images/";

and it uploads the image to /admin/images/ as the page i'm running it from is in the admin directory.

I've tried just using the http:// and it doesn't like it. Could someone please tell me how i can make it upload the image to /images/ instead of within the admin folder.

Upload To Specific Folder
I am working in a directory:

/www/domain/
and made the directory
/www/domain/images/

What I need is for people to be able to upload images to this folder from a form on upload.php They should click browse and select their file to upload then press the "Upload" button. On the next page I want to display the .jpg or .gif that they uploaded.

What is the coding for uploading that should go into the first upload.php script and the coding for the upload_result.php script. I think that the result could be:

echo "<img src="images/$file">"; where $file = the image they uploaded. But I cannot seem to figure out what the first code should be.

Any Way To Upload Entire Folder?
I'm currently working on a little program that will allow different departments within where I work to upload videos (like training videos or safety videos) and then keep track of who watches them. My guess is that I'll do most of the uploading myself, but I wanted to make it such that I can give anyone access to the upload script so they could do it themselves.

Anyway, we (at the office) all agreed that Flash is the best format for security and ease of distribution. We went out and got a program that will allow conversion of video files to flash and also allow them to have a nice table of contents and controls. The biggest problem is that for the TOC and controls to work on the flash videos, the program creates a friggin mess of files that all relate to each other... and this screws up my 'easy' upload idea. There's no way for this program to create a nice single .swf or .fla that has all the controls and TOC built in, at least not that I've found. :(

Is there any way, other than zipping up a directory and writing an unzipper for the server side, to allow a user to specify a directory where the video resides and just up the whole thing intact?

If not, I suppose I'll have to settle for the single .flv file that is created and dump the controls and TOC... though that's part of the reason we bought this converter program. I'm trying to write it in such a way that it will also play mpegs and avi files down the road if that's what the department has, but to start out we're asking that they send us the movie file so we can convert it to flash.

Upload And Resize To Folder
What I have here is an image upload and resize form. I do not want to maintain aspect ratio as I am using this in a slideshow, so I want to maintain exact width and height with all images.

The problem with the script is that it outputs that the file has been uploaded successfully but upon checking the filename is there but its at 0 bytes ! Code:

Can PHP Upload Outside Websever Folder?
I've built a photo database on the intranet with PHP and MsAccess database. I've completed the application with http upload. All works fine untill i found out that upload works only in webserver folder. Which means the files cannot be uploaded into another drive on my web hosting computer.

The problem is the hard-disk size of my webserver partition will not be enough for the photos in the future. Anyone have a solution to this? I want a php script that can upload files to differen partitions of my hard-disk and possibly into diffrent network storage folders.

Upload Scripts To A Folder On The Server
Does anyone have a good upload file script for uploading powerpoints to a folder on the server? Not a database?

Remote Upload Script Problem
ive created a Client and remote upload script to upload these file types:

jpg, JPG, gif, png, PNG, bmp, zip, ZIP, rar, RAR, exe and EXE

the problem is, if the user uploads say an EXE through FTP, it give me an error. HTTP works perfectly. I just cant get the FTP to work with exe, EXE, rar, RAR, zip or ZIP. it works fine with images... just not them. Code:

Remote Using Of Php Files
i am trying to connect a php file which has a function from another site... using this,

require("www.somesite.com/some.php");
somefuncs();

but it doesn't run it, but if i give that some.php as some.php.inc it shows the code when i try to see it... so whats the solution?

PHP Can Only Upload File Into A World-writeable Folder?
Every time I try to upload a file, it works fine until I use move_uploaded_file() to try to place it in its destination, then I get an error to the effect of:

Warning: Unable to create '/path/to/file.ext': Permission denied in /path/to/script.php on line XX

This error goes away when I make the folder I'm trying to move the file into a world-writeable one.

Has it been other peoples' experience that making the upload folder world-writeable is the only way to move new uploaded files into it?

How To Get The Files Names From The Folder Using PHP ..
How to get the files names from the folder using PHP .. is there any
specific command. If yes let me know that..

Paging Of Folder Files
i have a form which has a select button when user clicks it a popup opens which shows all images in abc folder
 
when user clicks on any image the window closes and the name of that image is entered in the text box in parent form, now its working fine uptill here but if user refresh the popup window then it disconnects from parent window so my code that fills the textbox in the parent form and closes the popup window does not work anymore im using it like parent.document.form.texthox.value=abc since popup window is refreshed it does not work as child any more and this code does not work.

Files And Folder Copying
I am trying to write a function to copy an existing folder and folder
structure but am already stuck.

What I want to do is the following:

Copy a default folder (default_folder) and all sub folders within it (down
to a possible 4 levels)
eg default folder
->subfolder1
->subfolder2
->sub subfolder1
->sub sub folder 2

I have a form where the user can enter the name of the new folder and an
option to confirm if they want to copy the files also located within the
default folder.
If the checkbox is not checked then copy just the folder structure only

Can this be acheived in one function or will it be based on 2 where a set of
empty folders are created and where the folders and files are copied over

What Is The Max PDF Files Allowed In A Folder?
Not sure where to put this question? I am building a book archives database with a front-end for some librarians. They want to upload book cover images onto the server (probably Win-NT). There are approximately 80000 records that will have the book cover images stored in a PDF document for each. Can I upload every PDF to the same folder? Is there some kind of limit for a folder?

Deleting Files From A Folder...
I have a folder with many pictures in it.
All have the name like: HHMMDDMMYYYY.jpg

H-hour
M-minute
D-day
M-month
Y-year

Now I want to delete all pictures which are older than now()-7days.
How Can I do it? In SQL would be no prob but with file deleting is problem.

Opening Files In The Same Folder..
I have a php file (1.php) that needs to open another php file (2.php) and parse it's output. 2.php gets it's data from an xml file and formats it in a pretty screen style. So what I need is something like: $fp = fopen ("2.php?file=file.xml","r"); but that wont work because there is no file called &#392;.php?file=file.xml' so how's it done?

1 - 2 Millions Files In One Folder?
I have to store over a million files, 10 - 15 kb each, in one folder.
The files are created by my php script, sometimes the old files are
deleted and new ones are written.
So, basically on every connection my script reads/deletes/ writes files
from/to that folder.
Right now i have only around 300 000 files in that folder, and it feels
like its getting slower for that script to work. It does work at the
moment, but i am not sure what will happen when there is over a million
files there...
Are there any limits of files that can be stored in a folder?
Would it be better for me to use mysql? I am not sure how mysql will
cope with millions of writes/reads

How Does One Get A List Of All Files In A Folder?
need a list of all files (i have like 5k or so) in a folder, I need to add there names to a table

I am doing this so i can compare two tables

table 1. comments added to uploaded pics -finished pictures-
table 2. no comments added yet to uploaded pics (so they can be commented on GET IT?)  -unfinished pictures-

All the pictures are in a single folder for the time being i'm going to be making a form based on the pictures that are on table 2 so that they can have comments and titles and file name added to table 1 (to be done still) but i need to know all the file names for the folder in question, i guess i could do it via cmd line ls or something like that, i'll get back to you.

Pagination W/ Just Files In A Folder?
Example would be:

prev 12345 next

but doing this with just files and not DB records?

Viewing Files In A Web Folder
I'm trying to put my files in a web dirctory.  All kind of files, so that in the future when I need something I just go there and get them.  My goal is that when I type "www.domain.com/myVitualDirectory" I would get my list of files and folders and files and I would even be able to navigate into the folders, then I would right click and Save Target As and get my file.

Php Include Files From A Folder
I want to make a folder filled with blog posts by date.  Each file will be like 20071113.php and 20071031.php basically the date they were written 2007, 10 for october, and 31 for the day.  But each will be notated like that so that the number is always increasing. 

How would I make a php include function as to take the last ten highest numbers and add it to a page? (Basically the last ten posts by date) and  How would I include more than one post per date?

Copying Remote Files
How do i copy a picture or another file from a remote webpage, and put it into my webpage dir?

Filectime() For Remote Files?
Is there a function that will give me the same output as filectime(), on remote files?
What I'm trying to do is check the last time a remote file was modified, and if it's different from the stored time that I have for it, the file is downloaded and overwrites the local file. I've done pretty much everything except retrieving when the remote file was last modified.

Copy Files From Remote URL
how can I copy a file from a url into the directory where my php file is located?

On the server I use it is not possible to use the copy() function for this task.

Running Remote Files
My shared web hosting account does not support cron tabs. So what ive done is asked a friend who has an account that does to run a local file on his server called "mikescron.php".

I need that file to somehow open or run a file on my host. Ive seen this done with headers and also with file functions before, but i cant find any documentation on it. WOuld anyone have any suggestions or sample code. On another note does anyone have a better idea about the cron.

Reading Remote Files
I'm attempting to read a remote file and parse it for data. The problem I'm
having is that the file seems to be generated by Perl
(http://alert.dot.pima.gov/scripts/1brpssd.pl) and when I read it the
script-generated data is not displayed. When I view the page with a browser
the data is displayed just fine. I've tried using the built-in PHP commands
to read the file (file, fget) as well as the all of the Snoopy "fetch"
classes

Picture Upload To Certian Folder When Button Pressed...
I have Three Submit buttons and a image uploader with user verifcation. What i want to happen is when you press the button that says "Submit Pictures", it will upload pictures to the "files/pictures/" directory, when you press "Submit School", it will upload files to the "files/school/" directory, and when you press "Submit Random", it will upload to the "files/random" directory. I made the script so that right now if the user and password are correct it wil upload to the directory "/files". Code:

Indexing Text Files In A Folder
I'm newbie on Php. I cannot write codes but only modify.
I need a code doing this:
I'll put text files in a folder like file1.txt,file2.txt ...
I want to search this files, list most recent 10 and if files

call, script will put into the site design with <pre> tags.

Dropdown List Of Files In Folder
I am preparing a form that includes a drop-down list consisting of the names of files in a certain folder on the server.

I only need to trap the file name (jpg), not the path and I'm not trying to upload the files or anything - simply allow the user to select one of a number of different image files (they're actually location maps).

Recursive Copy Of Folder/files
I want to copy entire content(have both files and folders)from One folder to destination folder..

Opening All Text Files In A Folder
Im very new to php and need a bit of help. basically what I have is a folder with a number of text files inside. What i need to do is open every text file in that folder and then process the information inside each text file.

Im not really sure but I would assume I open the directory and place the name of each text file into an array and then loop through the array and process the contents of the text file.

#open directory

#foreach text file in the directory
#store file name into an array

#loop through array
#process code

Display A List Of Files In A Folder
How do you display a list of files in a folder and then delete one by clicking on it?

Displaying Files In A Folder Using A Calender
I have excel sheets generated daily and weekly in this format for filenames..for daily sheets the filename is Jan-10-2002 (mmm-dd-yyyy) and weekly Week-39-2002. I have a script that uploads to a constant folder all the excel sheets.

Is there a script that can display the daily scripts in form of a calender. I.E a user can choose to view or download the sheet by choosing the date? Also another for displaying weekly excel sheets in a weekly format.

How Can I Return The Number Of Files In A Folder?
How can i return the number of files in a folder?

Return All The .html Files In A Folder?
I'm trying to find all the include files in a folder is there a way to some how read a folder and then return an array with all the file names as the array keys or associative keys? I only want to return files that are .html or .php not all files

Show Html Files In A Folder
I am trying to create a script that will parse the folder it's containing php page is in for html files. Create a drop down list of links to the html files.
Anyone know how I might do this?

Including Files In Remote Server
I have a perl script to grap headlines from slashdot and such for me, and I use corn to have it run hourly and put the headlines in a file on the linux server.

Now problem is that my site is sitting on a Windows 2000 Apache Server. So I can't seem to use include() to get the file into my page. Any suggestions or alternatives?

Save And Send Remote Files
I need to email linked files to email recipients, how would I
accomplish this?

I tried to download the remote file to the webserver and then attach
it to a new email message but the downloaded file headers seem to be
damaged and the file can't be used anymore (i tried both pdf and zip
files).

Could somebody help me in reading and writing the remote file to disc?
The rest should be easy...

Upload Questions - Upload 20 Files At One Time
I've a FORM to upload 20 files at one time, I want it upload 50MB without any problem. I need to set PHP execution to high time, I think, I use ini_set(). But, how can I specify maximum of 50MB, I've an array of 20 files in a FORM. Next I think, it's bad to allow 50MB, should I step-down to 10MB or what?

Deleting Files In A Folder Modified Before Certain Date
I use a cache system that requires creation of files in a folder .

Now , what i need to know is how can i delete files created say 3 days ago.

So that the cache remains fresh.

The directory contains around 20,000 files , about 10,000 are generated each day (if they dont exist)

So getting info about the each file after using opendir will cause the server to slow down.


Copyright © 2005-08 www.BigResource.com, All rights reserved