473,407 Members | 2,326 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,407 software developers and data experts.

getting files over ftp/http

Before I go on a mad quest to try to code some pages, I think it's
probably prutent to ask something. If I were to pass a php page either
an ftp or http address of an image file (assuming it had a username and
password coded in), would I be able to make it go and get that file and
save it in a folder local to that page?

Aug 10 '06 #1
2 1635
Rik
Cl*******@hotmail.com wrote:
Before I go on a mad quest to try to code some pages, I think it's
probably prutent to ask something. If I were to pass a php page either
an ftp or http address of an image file (assuming it had a username
and password coded in), would I be able to make it go and get that
file and save it in a folder local to that page?
As far as I understand your question, perfectly.
Look into fopen(). (Check wether allow_url_fopen is enabled in your
settings), or look at the PHP FTP functions:
http://www.php.net/manual/en/ref.ftp.php

Grtz,
--
Rik Wasmus
Aug 10 '06 #2
Rik wrote:
Cl*******@hotmail.com wrote:
>>Before I go on a mad quest to try to code some pages, I think it's
probably prutent to ask something. If I were to pass a php page either
an ftp or http address of an image file (assuming it had a username
and password coded in), would I be able to make it go and get that
file and save it in a folder local to that page?


As far as I understand your question, perfectly.
Look into fopen(). (Check wether allow_url_fopen is enabled in your
settings), or look at the PHP FTP functions:
http://www.php.net/manual/en/ref.ftp.php

Grtz,

Try using file_get_contents works alot better when it comes to opening
URLS since the stream might be caught off when using fopen.

Concerning if you can download the image straight from a URL
call...hummmmmmm

#1. What you can do is hit the page
#2. Remove all references (image paths) from the page
#3. Open up the images individually using imagefromjpg($path) <-- ?
#4 Save the stream that the imagefromjpg returns as a jpg file. :-)

Armando Padilla
Aug 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Opa | last post by:
Hi, Does anyone know how to get a list of files for a given directory from a given url. I have the following, but get an error indicating that URI formats are not supported. ...
5
by: Noorul Ameen | last post by:
Dear Folks, In a HTML page I want to get all the files in a selected dirs. Is that any way to do this thru javascript. Help will be highly appreciated. Thanks in advance. Regards, Ameen T
11
by: Brett | last post by:
In Yahoo mail, I click the Inbox link and see my messages. If I view source, I don't have HTML which contains the URL of each message. The source HTML contains javascripting and framesets. This...
2
by: Jenny Zhang | last post by:
Hi, I am running OSDL-DBT3 test against PostgreSQL. I found performance difference between the runs even though the data and queries are the same. I tried to study this problem by getting...
17
by: Arnold | last post by:
Is using fseek and ftell a reliable method of getting the file size on a binary file? I thought I remember reading somewhere it wasn't... If not what would be the "right" and portable method to...
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
7
by: chuckdfoster | last post by:
I am not sure if this is even possible, but I figured I'd ask some experts. How would I use an ASP.NET page to get a listing of all of the files that are in a folder. I am working on a page that...
3
by: =?Utf-8?B?WmlhbmdpIEpvbmVz?= | last post by:
Hi, I m using VS .NET 2003 to create a website. Using the setup package I create a setup as well. But this setup has files with actual code in it & not pre-compiled DLLs. Please let me know...
13
by: lawpoop | last post by:
Hello all - I have a two part question. First of all, I have a website under /home/user/www/. The index.php and all the other website pages are under /home/user/www/. For functions that are...
4
by: imaloner | last post by:
I am posting two threads because I have two different problems, but both have the same background information. Common Background Information: I am trying to rebuild code for a working,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.