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
#2
i solve my problem in another way.
i uploading my files via default Files-page with its own uploadify field. Then in my plugin i open directory that i need and import files from uploads folder to folder that i need. it is longer but working. Soon i'll post my extension to extension library ))
Reply
#3
you may be approached this plugin http://get-simple.info/forum/topic/1247/...gesplugin/
Reply
#4
it is not right what i need. i've ended my plugin http://get-simple.info/extend/plugin/sim...allery/67/
Reply
#5
Your plugin conflicts with other plugins
Reply
#6
can you write about problems? what plugins have you installed?!
Reply
#7
Code:
Notice: Use of undefined constant photo - assumed 'photo' in /home/cp068800/public_html/neowebtime.ru/0/plugins/portfolio.php on line 37

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/cp068800/public_html/neowebtime.ru/0/plugins/portfolio.php:37) in /home/cp068800/public_html/neowebtime.ru/0/plugins/squareit-gallery.php on line 14

Warning: Cannot modify header information - headers already sent by (output started at /home/cp068800/public_html/neowebtime.ru/0/plugins/portfolio.php:37) in /home/cp068800/public_html/neowebtime.ru/0/admin/inc/cookie_functions.php on line 26
Reply
#8
Oleg06, thx for your feedback. Corrected plugin and reload it to extesion library. If the problem will still occur, please write about it.
Reply
#9
Code:
Notice: Undefined variable: date in /home/cp068800/public_html/neowebtime.ru/0/plugins/portfolio.php on line 108

Code:
Warning: rmdir(/home/cp068800/public_html/neowebtime.ru/0/data/photo/ss) [function.rmdir]: Directory not empty in /home/cp068800/public_html/neowebtime.ru/0/plugins/portfolio.php on line 235
Не получается удалить. Папка ss не пустая.
вторая папка создалась пустая и как туда что-то загрузить?
Reply
#10
папка создалась сама или вы ее создали?! я у себя создавал много папок и никаких ошибок при удалении. Посмотрите ftp-клиентом с включенными скрытыми файлами, может это разъяснит ситуацию.
Кстати, как вы включили такие подробные ошибки?!
Reply
#11
папку я создавал сам еще с первой версией плагина
в gsconfig.php раскоментировал строку 19 define('GSDEBUG', TRUE);
в общем-то все работает, только эта надпись все-равно появляется
Code:
Notice: Undefined variable: date in /home/cp068800/public_html/neowebtime.ru/0/plugins/portfolio.php on line 108
дату почему-то не пишет
Reply
#12
папку создавать не надо плагин сам все создает. Видимо из-за того что вы руками папку создали он не дает из плагина удалить, так как прав видимо нет. Я специально по новой все установил, все папки удаляются/добавляются без проблем.

Дату оставил, просто чтобы не забыть куда добавлять. Сделаю чтобы когда список папок смотришь показывало количество файлов внутри. Ну типа рюшечка прикольная ))

как в целом по удобству?! делал по себя, так чт оинтересно как другим будет пользоваться ))
Reply
#13
Плагин то что нужно. Сам сидел над созданием такого же. А можно сделать так чтобы фотки не импортировать из папки upload а загружать прямо в созданные папку.

И еще... при импорте фоток переносит только ВСЕ файлы. При попытке удалить из списка возможных к импорту хотя бы одного выдает ошибку (((
Reply
#14
с загрузкой прям в папку проблема, я в первом посте писал что нифига не получилось, так что сделал так, если будет возможность сразу на прямую в папки заливать, то переделаю.
Про импорт сделаю чтобы можно было выбирать нужные к импорту и только их импортировать.
Рад что плагин полезен ))
Ждите дальнейших доработок и обновлений ))
Reply
#15
Извините, но я так и не понял, как вывести эту галерею на страницах сайта?
Какую функцию прописать в шаблон или прямо в редактировании соответствующей страницы?
Reply
#16
в любом месте в теме вставьте строчку <?php portfolio_site_view(); ?>, а в постоянную ссылку впишите имя папки где фотографии находятся
Reply
#17
This plugin does not work properly
It moves all the files in upload directory when I create a gallery with it.

And, could you step back to english, so we can follow you ?
Reply
#18
tazmandev, why doesn't it work properly? it moves all the files to folders that you create under data/photo. i did this to make more understandable file organization.

any more questions?
Reply
#19
privet! ya ochin lublu russkaja jazik a ya ni ponimaio kak rabotet etot plugin ...

I love Russia and russian language but I do not understand how this plugin works

1) maybe russian and english language files?
2) maybe a step by step instruction how to use these files?

3) does this work with actual version of getsimple?

4) how to integrate this into pages?

I feel frustrated... ;=(
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#20
this should be a feature that is part of the core in 3.0 Connie. Big things are coming with 3.0 soon....
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#21
I am no developer and I do not how to create a template file but I want to make this gallery work on my site. Please can you tell me how to make a gallery appear on a page. If I enter the folder URL I get just get the folder and index of page without the site theme
Reply
#22
hello

first: why the heck this plugin is in plugin secition? im hiding plugin section from my clients so they cant break page functionality

second:

what is this?

Портфолио
Новая галерея

0 галерей

english please (at least)
Reply
#23
@infografik: This thread is more than two years old and is not relevant for current versions of GS.
--
Nick.
Reply
#24
Can it be closed?
Reply




Users browsing this thread: 1 Guest(s)