Questions tagged [stream-wrappers]

PHP stream wrappers allow you to implement your own protocol handlers and streams for use with all the other filesystem functions.

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

How move_upload_file calls to custom stream_wrappers class

In a node form, I upload a image to the server via ajax and before to send to the uri, I want to optimize the original image (not a image style). How is possible that from move_upload_file that is a ...
0
votes
1answer
39 views

Why does include() call PublicStream::stream_set_option()?

I am including a PHP file that in stored in the public:// directory. (Yes, I know that's generally a bad thing, but there are reasons, and this is done on a local development server.) I get this ...
0
votes
0answers
43 views

Unable to upload a file

I have configured a file field to be encrypted with a RSA profile (via File Encrypt module). Everything works fine on the DEV environment (Windows) but when I deploy on the TEST environment (Linux), I ...
0
votes
1answer
46 views

Cannot instantiate interface DrupalStreamWrapperInterface

I am trying to replace drupal_realpath with realpath. What I did is $stream_wrapper = new DrupalStreamWrapperInterface(); $file_path = $stream_wrapper->realpath($img_path); But it gives me this ...
0
votes
1answer
72 views

Update programmatically value of field collection item

I want to update a field collection I have the following: function pdf_app_node_presave($node) { if (!$node->is_new) { global $base_url; if($node->type == 'article') { ...
0
votes
1answer
19 views

Get programmatically value of sub field collection item of a field collection

I have a field collection field library and a sub field collection field book which has a field collection item field title. to get the first field collection I use a wrapper: $node_wrapper = ...
1
vote
1answer
40 views

Storage API stream wrappers Traffic Usage

In my Drupal 7 Project I have configured Storage API stream wrappers in order to save all public and private files over ftp server. everything works well and files in public and private are copied ...
1
vote
2answers
674 views

how to get the url to usefor a private path

if I have a file saved in private:://somefile.txt , what function can I use in drupal to give me the external URL to access that? I tried PrivateStream::getExternalUrl() but I get this error PHP ...
0
votes
1answer
52 views

How to remove Storage API without data loss

I'm working on application based on Drupal 7.39 that use the Storage Api module version 7.x-1.8 with FTP container. I'm trying to achieve is to remove this module and use the normal flow to save ...
1
vote
1answer
25 views

Stream_flush in not being called while using stream wrapper

I've created a stream wrapper foo:// and when I am using this wrapper and my file moved successfully but the flush_stream function is not called I don't why I also checked for the public:// stream ...
0
votes
0answers
96 views

How to provide custom FileSystem?

I have StreamWrapper for Amazon S3 and I have noticed chmod is not working. I have looked into the \Drupal\Core\File\FileSystemInterface::chmod and it clearly states that contrib modules should ...
2
votes
1answer
862 views

DrupalTemporaryStreamWrapper::stream_open" call failed in file_unmanaged_save_data()

DrupalTemporaryStreamWrapper::stream_open call failed in file_unmanaged_save_data() I do not identify the problem. Could anyone help me?
-1
votes
2answers
582 views

Programmatically attach an image to a node using Storage API to store image in the Database

I am building a site where I need to store encrypted images in the database. I'm using the module Storage API as it supports saving images to the database. I modified the db.inc file to just add an ...
0
votes
0answers
724 views

Custom Stream Wrapper

I have a file field in a content type. The files uploaded by this field should be handled by a custom php script. I think the best way to get this done is to write a custom stream wrapper. However, I ...
0
votes
1answer
983 views

stream wrapper public /private not found Error

Configuration : WAMP on windows drupal 7 I have tried using $image = file_get_contents('E:\Team_Install\wamp\www\rootfolder\sites\all\modules\my_module\errorwinmobilesdk.jpg'); $file = ...
1
vote
0answers
146 views

Media module and StreamWrapper

I am using Media 7.x-1.3 on Drupal 7.21. I have created simple StreamWrapper to use with some other modules and it works great for them. It extends DrupalLocalStreamWrapper and overrides ...
3
votes
1answer
3k views

Move File Field storage from public:// to another stream wrapper (like s3://)

I've been looking around for this a bit, and it seems like it would be relatively easy in Drupal 7, since D7 supports stream wrappers, and Fields are part of core... but I can't find any documentation....
1
vote
1answer
550 views

Using ftp wrapper in file_copy

Can I use php ftp wrappers using file_copy or file_move. like this: file_copy($file, 'ftp://user:pass@site.com/file.flv', FILE_EXISTS_RENAME); Or is this limited to drupal default wrappers? And ...
0
votes
2answers
333 views

hooks call order and hooks dependency

I try to implement hook_menu() in a module and the code inside of this hook depends on another hook implemented in the same module Example: function mymodule_menu() { $streamwrapper = ...