473,401 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

How to get the filenames of a directory in a diferrent host?

mikek12004
200 100+
I want to take all filenames inside a specific folder and do some stuff with them. When the Processing script was inside the same server-host I used
Expand|Select|Wrap|Line Numbers
  1. $msg=glob($newpath."/*.flv")
where newpath the directory each time in use but now I have moves the flv to a faster server and wish to maitaim the script in the old one (mainly because the database resides also there) glod will not work with a url. Do you know any solution?
Dec 31 '08 #1
3 1398
code green
1,726 Expert 1GB
You could try opendir and readdir
Dec 31 '08 #2
mikek12004
200 100+
Found another way around. Made a script within the remote server which takes all the filenames of a directory and writes them in a txt. Then from my page call this reote script and then get the created txt with hte file() which takes remote files (as long as you have enabled the corresponding variables in php.ini)
Jan 2 '09 #3
xNephilimx
213 Expert 100+
mikek12004 you can't access the filesystem of another server as you where on the same one, what you can do is, suck it up and move the db and the script to your new server, which would be the easiest and fastest way to do it, move a db is really not complicated at all.
Other thing you can do is make a script in the new server that outputs the contents of the flv file as plain text (readfile or some other function, maybe you can base64+chunk_split encode it) and in your old server make a script that gets that with cURL, then save that contents as an flv file and do all the stuff you need with the script you already have.

See what suit's you best, my recommendation is the first one.
Jan 2 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: hokiegal99 | last post by:
This script works as I expect, except for the last section. I want the last section to actually remove all spaces from the front and/or end of filenames. For example, a file that was named " test ...
2
by: dimitri pater | last post by:
Hello, I use the following script to list the files and download files from my website (99% of the code is from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/200131). The problem is...
5
by: Mark | last post by:
How can I populate a listbox with a list of the filenames in a certain folder? Can a query retrieve the filenames from a folder? Thanks! Mark
8
by: Tim | last post by:
Does anyone know a way to read the filenames from a given directory in C in a Solaris environment? I did this, but it seems goofy: sprintf(t, "ls *.csv > filenames.txt"); system(t); fptr =...
2
by: rbutch | last post by:
guys, i need a little help with this. this is working (well sort of) i get the info, but it's not moving to a new line as it iterates thru the array and all of the fields are like ONE HUGE LONG...
6
by: I_AM_DON_AND_YOU? | last post by:
I have a small VB.Net Solution. The solution has filename LABELMAKER.SLN and the the project has filename LABELMAKER.VBPROJ. There is another file LABELMAKER.VBPROJ.USER. All these are in a...
0
by: n33470 | last post by:
We have a web site that is being converted from the 1.1 format into 2.0. I've noticed that after the web project has been converted, the first time that the solution is opened in VS, all of the...
22
by: rtilley | last post by:
# Spaces are present before and after the XXX filename = ' XXX ' new_filename = filename.strip() if new_filename != filename: print filename Macs allow these spaces in file and folder...
2
by: Taras_96 | last post by:
Hi everyone, Firstly, I would like to know if you can open chinese filenames under win2000 using PHP 5.0? I have a file named 中国.php, and try to open it using fopen(‘中国.php','r');....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.