0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Pleasanterからサーバー内フォルダ作成しファイル共有

0
Posted at

基本環境

Pleasanterバージョン:1.5.2.0
Windows Server 2025 Standard 24H2
SQL Server 16.0.1

やりたいこと

Pleasanter編集画面から
・サーバー内の特定のフォルダ内に新規フォルダを作成
・そこにファイルをアップロード
Pleasanterの別編集画面から
・同じフォルダのファイルをダウンロード

FileGatorの導入

ブラウザ画面から端末へファイルアップロードとダウンロードができる

PHPインストール

https://www.php.net/downloads.php?os=windows&utm_source=chatgpt.com
PHP 8.5.x → VS17 x64 Non Thread Safe Zip ダウンロード
Zipファイルを

C:\PHP

に展開

コマンドプロンプト

C:\PHP\php.exe -v

PHP 8.5.10 (cli) (built: Aug 25 2026 21:23:48) (NTS Visual C++ 2022 x64)
Copyright (c) The PHP Group
Built by The PHP Group
Zend Engine v4.5.10, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.10, Copyright (c), by Zend Technologies 

で成功

CGIインストール

Windows Server > サーバーマネージャー > 役割と機能の追加 > 役割ベースまたは機能ベースのインストール > 対象サーバー名:現在のWindows Server > サーバーの役割:✓Web Server(IIS) > 役割サービス:Web Server > アプリケーション開発 > ✓CGI > 次へ > インストール

ISSマネージャー > 対象サーバー名 > 「ISAPIおよびCGIの制限」があることを確認

IISとPHPの接続

ISSマネージャー > 対象サーバー名 > ハンドラーマッピング > 「操作」モジュールマップの追加 > 入力
要求パス:*.php
モジュール:FastCgiModule
実行可能ファイル:C:\PHP\php-cgi.exe
名前:PHP_via_FastCGI
> OK

PHPの動作確認

ファイル作成

C:\inetpub\wwwroot\phptest
<?php
phpinfo();
?>

IISの設定
対象サーバー名 > サイト:右クリック > Webサイトの追加 > 入力
サイト名:WebTest
物理パス:C:\inetpub\wwwroot
種類:http
IPアドレス:すべて未割り当て
ポート:8080
ホスト名:空欄
> OK

ブラウザで
http://対象サーバー名:8080/test.php
を開き、PHPのSpecページが表示されればOK

php.ini設定

C:\PHP\php.ini-production
をコピペし、
C:\PHP\php.ini
に名前を変更

php.ini設定

C:\PHP\php.ini
extension_dir = "ext"
extension=fileinfo
extension=mbstring
extension=openssl
extension=pdo_sqlite
extension=zip

以上を有効化

コマンドプロンプトで再起動

iisreset

IIS successfully restarted.

ブラウザで
http://対象サーバー名:8080/test.php
を開き、

Loaded Configuration File(none):C:\PHP\php.ini

zip
Zip
Zip version
Libzip

と表示されれば成功

FileGatorインストール

https://github.com/filegator/static/raw/master/builds/filegator_latest.zip?utm_source=chatgpt.com
よりダウンロード
ZipをD:\Data\FileGatorにすべて展開

FileGator設定

D:\Data\FileGator\private フォルダを右クリック > プロパティ > セキュリティ > 編集 > 追加:「選択するオブジェクト名」IIS AppPool\FileGator > 名前の確認 > OK
「グループ名またはユーザー名」FileGator > アクセス許可 > 変更、読み取りと実行、フォルダーの内容の一覧表示、読み取り、書き込み に✓(フルコントロールは✓なし) > 適用 > OK

ブラウザで
http://localhost:8081/index.php
を表示
FileGatorログインページが表示されれば成功

スクリーンショット 2026-09-15 154614.png

username:admin
password:admin123
でログインし新規パスワードを設定

IISマネージャーで公開設定

IISマネージャー > サイト:右クリック > Webサイトの追加 > 入力
サイト名:FileGator
物理パス:D:\Data\FileGator\dist
種類:http
IPアドレス:すべて未割り当て
ポート:8081
ホスト名:空欄
> OK

FileGatorホームディレクトリ設定

D:\JtrimPlmData\FileGator\configuration.php
'adapter' => function () {
    return new \League\Flysystem\Adapter\Local(
        __DIR__ . '/repository'
    );
},

__DIR__ . '/repository'
↓
'D:/Data/ShareFiles'

Windows Serverフォルダ共有設定

D:\Data\ShareFilesを右クリック > プロパティ > セキュリティ > 編集 > 追加:「選択するオブジェクト名」IIS AppPool\FileGatorr > 名前の確認 > OK
「グループ名またはユーザー名」FileGator > アクセス許可 > 変更、読み取りと実行、フォルダーの内容の一覧表示、読み取り、書き込み に✓(フルコントロールは✓なし) > 適用 > OK

ブラウザで
http://localhost:8081/index.php
を表示
D:\Data\ShareFiles内にあるフォルダが表示されれば成功

新規フォルダ作成

Pleasanterパラメータ設定

$ps.file
を使うために、

C:web\Pleasanter\Implem.Pleasanter\App_Data\Parameters\Script.json
 "DisableServerScriptFile": true,
 ↓
 "DisableServerScriptFile": false,

デフォルトディレクトリ設定

 "ServerScriptFilePath": null
 ↓
 "ServerScriptFilePath": "D:\\JtrimPlmData\\ShareFiles"

IISのDefault Web Siteを再起動

共有フォルダ作成ボタン

Pleasanterスクリプト
$p.events.on_editor_load = function () {
    $('#' + $p.getField('DescriptionX')[0].id).after(
                $('<button id="button-makeShareFolder" data-method="post" type="button" style="float: left;" class="edit-page-button">共有フォルダ作成</button>')
                .button({ icon: 'ui-icon-arrowthickstop-1-s' })
                .on('click', function() {
                    $p.send($(this));
                })
            );
    }

Titleの名前のフォルダを作成

Pleasanterサーバースクリプト
if (context.ControlId === 'button-makeShareFolder') {
    const manageNumber = model.Title;
    $ps.file.createDirectory(manageNumber, '')
    }

作成したフォルダパスとアクセスリンクを保存

Pleasanterサーバースクリプト
if (context.ControlId === 'button-makeShareFolder') {
     const folderPass = `D:\\\\対象サーバー名\\ShareFiles\\${manageNumber}`;
    const folderUrlLink = 'http://xxx.xxx.xx.xxx:8081/index.php#/?cd=%2F' + manageNumber;
    let data = {
    Keys: ["Title"], // 参照するデータを指定する
    Title: model.Title,
    DescriptionHash: {
      DescriptionA: folderPass,
      DescriptionB: folderUrlLink
        }
    };
    items.Upsert(100, JSON.stringify(data));
    }

参考記事

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?