Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37670

Re: Serving Files In Plugins?

$
0
0
by Luis de la Torre.  

Hi! I finally learnt how to do it.

It wasnt that difficult, actually. Although it took me several hours blush

Basically, you just have to do what Tim said in the _pluginfile funtion: control if the users should have access to the file or not and (this part wasnt mentioned by Tim), if they should, then call send_stored_file().

My problem was of a different kind. During my tests I changed the component field in the file table of the database and so, for each test I carried out, the result was always: "Error, file not found". This happens because send_stored_file() checks if the pathname for each file (see the example posted by Marinko) corresponds to its coded value in the pathnamehash field of the file table.


Viewing all articles
Browse latest Browse all 37670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>