간단한 질문인데 답변 부탁드립니다. 채택완료
xargs
11년 전
조회 4,197
제가가지고있는 제이쿼리파일업로더안에 upload.php 부분에 파일이 저장될 경로를 입력하는 부분이 있습니다.
아래처렁요..
'upload_dir' => dirname($this->get_server_var('SCRIPT_FILENAME')).'/files/',
그럼 서버의 files 폴더안에 저장되는 형태였습니다.
근데 윗부분에 files 를 지우고, 로그인중인 회원의 ID로 변경하고싶은데
=$member['mb_id']?>
$member['mb_id']
해봐도 아무것도 안되네요 ㅜㅜㅜㅜㅜㅈ
제발 도와주세여여영
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
채택된 답변
+20 포인트
답변에 대한 댓글 3개
x
xargs
11년 전
답변감사드립니다. 근데.. '/' 여기서 끝나버리는것같아요ㅠㅠㅠ root폴더안에 내용들이보이네여
�
뽁스
11년 전
해당 코드 위쪽에 아래처럼 했을때 회원아이디가 나오나요?
echo $member['mb_id'];
echo $member['mb_id'];
�
뽁스
11년 전
[code]
<?php
$member = array('mb_id' => 'ddd');
$dd = 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_dir' => '/'.$member['mb_id'].'/',
//'upload_url' => $this->get_full_url().'/files/',
'user_dirs' => false,
'mkdir_mode' => 0777,
'param_name' => 'files'
);
var_dump($dd);
?>
[/code]
위에처럼 해보니 정상출력은 되는데요.. 어디가 문제인지 저도 잘 모르겠네요.
잘 해결하시길 바랍니다.
<?php
$member = array('mb_id' => 'ddd');
$dd = 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_dir' => '/'.$member['mb_id'].'/',
//'upload_url' => $this->get_full_url().'/files/',
'user_dirs' => false,
'mkdir_mode' => 0777,
'param_name' => 'files'
);
var_dump($dd);
?>
[/code]
위에처럼 해보니 정상출력은 되는데요.. 어디가 문제인지 저도 잘 모르겠네요.
잘 해결하시길 바랍니다.
댓글을 작성하려면 로그인이 필요합니다.
11년 전
</p><p><?php
),
?>
<?
class UploadHandler
{</p><p> protected $options;</p><p> // PHP File Upload error message codes:
// <a href="<a href="http://php.net/manual/en/features.file-upload.errors.php" target="_blank" rel="noopener noreferrer">http://php.net/manual/en/features.file-upload.errors.php</a>"><a href="http://php.net/manual/en/features.file-upload.errors.php" target="_blank" rel="noopener noreferrer">http://php.net/manual/en/features.file-upload.errors.php</a></a>
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'
);</p><p> protected $image_objects = array();</p><p> 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'
),</p><p> </p><p>
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인