By editor, 1 December, 2015 Question How to download a file from URL into drupal files system ? Example: $url = "http://domain.ext/filename.txt"; $result = system_retrieve_file($url, $destination = NULL, $managed = FALSE, $replace = FILE_EXISTS_REPLACE); Return value If it succeeds and $managed is FALSE, the location where the file was saved. If it succeeds and $managed is TRUE, a \Drupal\file\FileInterface object which describes the file. If it fails, FALSE. Tags Drupal 8 Code Comments You must have JavaScript enabled to use this form. Your name Subject Comment About text formats Text format Plain textBasic_html Plain text No HTML tags allowed. Lines and paragraphs break automatically. Web page addresses and email addresses turn into links automatically.
Comments