Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

UPLOAD FILES TO CURRENT DIRECTORY???
https://www.tinywebgallery.com/forum/viewtopic.php?f=13&t=3192
Page 1 of 1

Author:  jp_powell [ 28. Dec 2011, 05:12 ]
Post subject:  UPLOAD FILES TO CURRENT DIRECTORY???

Hi

I am running JFU 2.15 on a Joomla 1.7.3 website and I am using the backend port of JFU to upload my files. What I want to do is to navigate to the specific folder of where I want to upload the files to. Then upload the files to THAT folder.

Right now, no matter which folder I am in, the files get uploaded to the UPLOAD folder which is often times several folder off the mark of where I actually want to upload the files to. That means more work for me to upload, then find the files and then MOVE them to the correct location.

I want to upload to the CURRENT folder of where I am.

Thanks!!

Author:  TinyWebGallery [ 28. Dec 2011, 10:57 ]
Post subject:  Re: UPLOAD FILES TO CURRENT DIRECTORY???

Files should always be uploaded to the shown directory (only if you have a plugin (e.g. the move plugin) that moves the files somehow this is different).

Have you set the session save handler to none? Because otherwise Joomla does not share the session properly and maybe then the new directory is not set correctly on the server side.

You can always enable upload debug (or the debug in general) to see what is happening during upload.

Best, Michael

Author:  jp_powell [ 28. Dec 2011, 18:18 ]
Post subject:  Re: UPLOAD FILES TO CURRENT DIRECTORY???

Checking that out in a few mins ....will post results

Author:  jp_powell [ 29. Dec 2011, 00:44 ]
Post subject:  Re: UPLOAD FILES TO CURRENT DIRECTORY???

was interrupted and side tracked ....finally remembered to test ....

I have JFU with 2 plug ins installed ...move and unzip. I did not edit the move plugin because the target folder is not going to be fixed all the time. Users will navigate to whatever folder they need to upload photos/files to and then upload the files. So the move plug in should be taking the current directory as parameter.

Right now, the PHP line reads:
$userdir = $_SESSION['TFU_ROOT_DIR'] . '/upload';

What does this need to be changed to in order to pass the current directory correctly?

Here's the log of the test upload

12.28.2011 16:32:21 - 4. Check valid extension: background-parquet-xc.jpg
12.28.2011 16:32:21 - 4a. Extension valid.
12.28.2011 16:32:21 - 5. Before move_uploaded_file : /tmp/phpOtwBkX -> ./__/__/__/__/images/old/questionablefiles/test/background-parquet-xc.jpg
12.28.2011 16:32:21 - 5a. After move_uploaded_file.
12.28.2011 16:32:21 - 6. Uploaded.
12.28.2011 16:32:21 - 7. Internal processing done.
12.28.2011 16:32:21 - 8. Execute plugin: move_plugin.php
12.28.2011 16:32:21 - 8. Execute plugin: unzip_plugin.php
12.28.2011 16:32:21 - 8a. End plugins
12.28.2011 16:32:21 - 9. End upload
12.28.2011 16:32:21 - 10. End store session

Oh wait -- I think I saw a post in the forum about this ....let me go look ....

Author:  jp_powell [ 29. Dec 2011, 01:52 ]
Post subject:  SOLVED Re: UPLOAD FILES TO CURRENT DIRECTORY???

the post I saw a clue in is
viewtopic.php?f=13&t=3034&start=0

And fixed the move php file to use the _SESSION['tfu_dir'] variable

Now it works.

Author:  TinyWebGallery [ 29. Dec 2011, 11:03 ]
Post subject:  Re: UPLOAD FILES TO CURRENT DIRECTORY???

So why do you use the move plugin anyway?

You can use this to e.g. move all uploads to a predefined location. Without the plugin the files are uploaded to the directory you select in the flash.

- Michael

Author:  jp_powell [ 29. Dec 2011, 17:54 ]
Post subject:  Re: UPLOAD FILES TO CURRENT DIRECTORY???

At first, I thought we needed that because sometimes we need to move files from one folder to another. But after working through this issue, the description of this move plug in is open to possible mis-interpretation. That's what happened ...I mis-interpreted the intention/purpose of this plug in.

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/