g'day,
i want to access the uploaded files with another php script (myowntvchanel), but drupal seems to interfere in some way, not allowing it to access the files it creates

is there a way to allow it access, or move the upload directory completly outside the drupal file tree ?
-joseph

Comments

gollyg’s picture

not really sure, but make sure that your path is specified correctly - remember drupal will rewrite requests if it is in a subdirectory, so / resolves to this directory. If you are executing a script on the same sever you may find that your path needs to be based in your user home directory, and the current path is not pointing to the drupal directory.

If the issue is when you try to access the files from a remote server via http you could check htaccess in the root of drupal, there are some file rewrites going on, but i think this is unlikely.

mm167’s picture

3 issues ..

1. (drupal) index.php is a gate keeper. if your php script is under index.php (i mean, in a sub folder under it), u have to add register your php as a drupal callback, such that index.php will not stop u.

if u place your php script next to index.php (same folder as index.php), index.php will not border u.

2. of course, your php script needs to use correct paths of the files u want to access.

3. check if your .htaccess(s) allow your script to access the files.

cog.rusty’s picture

Drupal doesn't interfere with real files. Make sure that you have specified the file paths correctly. If Drupal can read the files, your script can too.

For a more specific answer, give us some code. How exactly your script tries to get the files and what exactly happens.

---- Edited to add:

The only thing that drupal does for uploaded files is that, if they are scripts, it doesn't allow them to run (for security reasons). It does that by creating a small .htaccess file in the files directory, containing SetHandler SomeIrrelevantString.

probocop’s picture

Hi,

Is there a way of using this htaccess file to only allow access to a specific script (rotate.php)?

Thanks,
Dave

cog.rusty’s picture

Probably not with SetHandler. I don't think it can pick individual files from a directory.

What are you trying to do? You want to allow a script to run inside your uploads directory? Why there?

Or do you have the script somewhere else, together with other scripts which you don't want to run? (In that case, why do you have them?).

RobertPope’s picture

can you use


<?php print $directory."mytvchannel.php" ?>

for example?