Jump to content

upload file from link


razaviv

Recommended Posts

have you looked into forms and server-side languages? I assume you want to either get someone to upload a picture or let them provide an absolute reference to a image that you can then use on your website?

Link to comment
Share on other sites

take the link that someone posted in an input at my site . . .
Please clarify what you mean by this. A link means this:
<a>http://www.somewhere.com/file.jpg</a>

Or do you only mean a URL:

http://www.somewhere.com/file.jpg

If you copy a file from an Internet address, look into file_get_contents to get the original file and file_put_contents to write the file to your server.If your PHP version is less than 5, you may need to look into the cURL library. I don't remember if file_get_contents supports remote file reading in versions earlier than 5.

Link to comment
Share on other sites

i will try explain it better.someone post a URL in my site by text input.i want to take with php the URL information (picture) and upload it to my server for specified folder by specidied name. how can i do that?and also, if i want to upload something to folder which is backward to the folder the file is the ftp, how can i do it?i mean - move uploaded file, to a PARENT folder, how can it be?thanks.

Link to comment
Share on other sites

i will try explain it better.someone post a URL in my site by text input.i want to take with php the URL information (picture) and upload it to my server for specified folder by specidied name. how can i do that?
I think you're getting confused, this is what DD was trying to clear up. A URL would be a link, like http://www.somewebpage.com/image.jpg. I think what you are asking for is the actual file itself, to be uploaded from the users system, correct? Or do you want to be able to take a live link to an image and then physically get a copy of that image to your server?
and also, if i want to upload something to folder which is backward to the folder the file is the ftp, how can i do it?i mean - move uploaded file, to a PARENT folder, how can it be?thanks.
I think when files are uploaded they are put into temp directory, which you can then have access to via PHP (SESSION? maybe) and then move anywhere on yourt server you want. I'm sure you can look it up in the PHP manual too for specifics.
Link to comment
Share on other sites

Do you mean how do you create a path to the file directory level above the current one, e.g. '../' ?

Link to comment
Share on other sites

i want that some admin will advertise a URL,then the php will take the picture from the URL, and upload the same picture to my server - so now you can access the same picture from my server.and the second thing: lets say that i have such thing:public_html directory and inside this i have two folders: myadmin and upload.i have php file in the myadmin and i want from this file of php to upload to the upload directory (parent directory)where to direct it?if i have upload directory inside the myadmin directory i just write: upload/what should i write?i wrote public_html/upload/and it wont works.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...