Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Upload files to subfolders
#1
Task
I want to make plugin that will upload files to subfolders from administator's panel without using ftp-clients.
Is there any working solution to upload files not only to /data/upload, but in to different subfolders? For example /data/upload/folder1, /data/upload/folder2.
What i did?
I replaced $targetPath in upload-ajax.php with the constant that dynamically creats before uploading, but i think that this constant works only on that page and i couldn't pass it to upload-ajax.php. So in this case $targetPath is empty and files uploading to the /admin folder.

Next i tried to get a folder name via $_GET array, so it looks like $targetPath=GSDATAUPLOADPATH.$_GET['folder'];
in this case $_GET part didn't get any thing, so files was placed in default upload folder.

Also i tried to write folder path to the file on disk and in upload-ajax read it to get folder path. And to check $targetPath variable after reading file with folder path i rewrite it with $targetPath value. In this case when i writed folder path to file it is OK. But when i write back value of $targetPath file was empty. I think that $targetPath was empty to and uploaded files was saved to /admin folder.

Can anybody help with this problem. How to pass dynamically folder path to upload function or it couldn't be done and better way is to upload files to default upload folder and then replace it in the needing folder.
Reply


Messages In This Thread
Upload files to subfolders - by arse.bandit - 2010-12-24, 20:54:49
RE: Upload files to subfolders - by cornelombaard - 2013-09-11, 20:36:22
RE: Upload files to subfolders - by infografik - 2013-09-15, 21:54:30
RE: Upload files to subfolders - by hameau - 2013-09-16, 18:06:09
RE: Upload files to subfolders - by datiswous - 2013-09-17, 19:24:26
Upload files to subfolders - by arse.bandit - 2010-12-25, 23:49:53
Upload files to subfolders - by Oleg06 - 2010-12-26, 02:29:25
Upload files to subfolders - by arse.bandit - 2010-12-26, 13:39:06
Upload files to subfolders - by Oleg06 - 2010-12-26, 18:35:04
Upload files to subfolders - by arse.bandit - 2010-12-27, 03:36:09
Upload files to subfolders - by Oleg06 - 2010-12-27, 03:57:06
Upload files to subfolders - by arse.bandit - 2010-12-27, 04:32:02
Upload files to subfolders - by Oleg06 - 2010-12-27, 05:49:15
Upload files to subfolders - by arse.bandit - 2010-12-27, 06:12:13
Upload files to subfolders - by Oleg06 - 2010-12-27, 06:27:57
Upload files to subfolders - by arse.bandit - 2010-12-27, 07:15:35
Upload files to subfolders - by tat911 - 2010-12-29, 13:28:05
Upload files to subfolders - by arse.bandit - 2010-12-29, 22:41:58
Upload files to subfolders - by sergio - 2011-01-16, 01:30:42
Upload files to subfolders - by arse.bandit - 2011-01-16, 02:27:33
Upload files to subfolders - by tazmandev - 2011-01-25, 14:26:56
Upload files to subfolders - by arse.bandit - 2011-01-25, 18:50:39
Upload files to subfolders - by Connie - 2011-03-03, 16:58:05
Upload files to subfolders - by ccagle8 - 2011-03-03, 23:17:27



Users browsing this thread: 1 Guest(s)