간단한 질문인데 답변 부탁드립니다.
본문
제가가지고있는 제이쿼리파일업로더안에 upload.php 부분에 파일이 저장될 경로를 입력하는 부분이 있습니다.
아래처렁요..
'upload_dir' => dirname($this->get_server_var('SCRIPT_FILENAME')).'/files/',
그럼 서버의 files 폴더안에 저장되는 형태였습니다.
근데 윗부분에 files 를 지우고, 로그인중인 회원의 ID로 변경하고싶은데
<?=$member['mb_id']?>
$member['mb_id']
해봐도 아무것도 안되네요 ㅜㅜㅜㅜㅜㅈ
제발 도와주세여여영
답변 2
.'/'.$member['mb_id'].'/', 이렇게 해보세요~
<?php
),
?>
<?
class UploadHandler
{
protected $options;
// PHP File Upload error message codes:
// http://php.net/manual/en/features.file-upload.errors.php
protected $error_messages = array(
1 => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',
2 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
3 => 'The uploaded file was only partially uploaded',
4 => 'No file was uploaded',
6 => 'Missing a temporary folder',
7 => 'Failed to write file to disk',
8 => 'A PHP extension stopped the file upload',
'post_max_size' => 'The uploaded file exceeds the post_max_size directive in php.ini',
'max_file_size' => 'File is too big',
'min_file_size' => 'File is too small',
'accept_file_types' => 'Filetype not allowed',
'max_number_of_files' => 'Maximum number of files exceeded',
'max_width' => 'Image exceeds maximum width',
'min_width' => 'Image requires a minimum width',
'max_height' => 'Image exceeds maximum height',
'min_height' => 'Image requires a minimum height'
);
protected $image_objects = array();
function __construct($options = null, $initialize = true, $error_messages = null) {
//alert(get_full_url());
$this->options = array(
'script_url' => $this->get_full_url().'/',
'upload_dir' => dirname($this->get_server_var('SCRIPT_FILENAME')).'/files/',
//'upload_dir' => dirname($this->get_server_var('SCRIPT_FILENAME')).'/'.$member['mb_id'].'/',
'upload_url' => $this->get_full_url().'/files/',
'user_dirs' => false,
'mkdir_mode' => 0777,
'param_name' => 'files',
// Set the following option to 'POST', if your server does not support
// DELETE requests. This is a parameter sent to the client:
'delete_type' => 'POST',
'access_control_allow_origin' => '*',
'access_control_allow_credentials' => false,
'access_control_allow_methods' => array(
'OPTIONS',
'HEAD',
'GET',
'POST',
'PUT',
'PATCH',
'DELETE'
),
'access_control_allow_headers' => array(
'Content-Type',
'Content-Range',
'Content-Disposition'
),
!-->
답변을 작성하시기 전에 로그인 해주세요.