Skip to main content
Remove wrong stuff
Source Link
schneidolf
  • 548
  • 3
  • 15

Drupal can only deliver files which located in public:// or in private:// folder.

Try the following explained here:

$handle = fopen('<path to local file>', 'r');
$file = file_save_data($handle, 'public://<filename>'file_default_scheme() . '<filename>');
fclose($handle);

and then try:

file_create_url('public://filename'file_default_scheme() . '<filename>');

Drupal can only deliver files which located in public:// or in private:// folder.

Try the following explained here:

$handle = fopen('<path to local file>', 'r');
$file = file_save_data($handle, 'public://<filename>');
fclose($handle);

and then try:

file_create_url('public://filename');

Try the following explained here:

$handle = fopen('<path to local file>', 'r');
$file = file_save_data($handle, file_default_scheme() . '<filename>');
fclose($handle);

and then try:

file_create_url(file_default_scheme() . '<filename>');
Source Link
schneidolf
  • 548
  • 3
  • 15

Drupal can only deliver files which located in public:// or in private:// folder.

Try the following explained here:

$handle = fopen('<path to local file>', 'r');
$file = file_save_data($handle, 'public://<filename>');
fclose($handle);

and then try:

file_create_url('public://filename');