Tuskony Posted November 5, 2008 Share Posted November 5, 2008 The title says it all.... I want to download images to my server using file_get_contents but I am not sure how I actually save these images once file_get_contents() has finished. A user inputs a URL into a form and clicks submit then the site downloads the image to my server. However I'm also not sure how I verify that they've entered a proper URL to a picture and not to a script or something like that... Thanks guys! Link to comment https://forums.phpfreaks.com/topic/131453-how-to-save-a-file-after-using-file_get_contents/ Share on other sites More sharing options...
Tuskony Posted November 5, 2008 Author Share Posted November 5, 2008 Bump! Link to comment https://forums.phpfreaks.com/topic/131453-how-to-save-a-file-after-using-file_get_contents/#findComment-682729 Share on other sites More sharing options...
Stephen Posted November 5, 2008 Share Posted November 5, 2008 You can use file_put_contents with the data you received and the filename. http://us3.php.net/manual/en/function.file-put-contents.php (or any fwrite-type command) Link to comment https://forums.phpfreaks.com/topic/131453-how-to-save-a-file-after-using-file_get_contents/#findComment-682746 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.