Thread subject: Explore Your Brain :: [help] upload file to different server

Posted by letsmove on 30-01-2013 05:13
#1


Deprecated: Function eregi() is deprecated in /home/explnorg/public_html/includes/bbcodes/code_bbcode_include.php on line 24

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/explnorg/public_html/includes/bbcodes/code_bbcode_include.php on line 29
brader.. mau tanya donk.
jadi gini ceritanya, saya mau upload file dengan source code berada misalkan di 192.168.6.4
nah tujuan upload saya pengen ke ip lain misalkan 192.168.6.5/exceldir/. itu bagaimana caranya ya supaya saya bisa upload ke directory exceldir tersebut.. saya menggunakan Codeigniter. dan ini penggalan dari function upload file saya.

Code

function upload_files()
{

$docPath = '"\\192.168.6.5\exceldir\"';
$status = "";
$msg = "";
$file_element_name = 'myFile';
$config['upload_path'] = $docPath;
$config['allowed_types']= 'xls';
$config['max_size'] = 1024 * 8;
$this->load->library('upload',$config);
$this->upload->initialize($config);





nah ketika dijalankan saya mendapat error message : "The upload path does not appear to be valid"

mohon bantuannya.. terima kasih

Posted by EVA-00 on 30-01-2013 14:43
#2

di CI ada library ftp class bro, yg fungsinya yaitu "CodeIgniter's FTP Class permits files to be transfered to a remote server. Remote files can also be moved, renamed, and deleted. The FTP class also includes a "mirroring" function that permits an entire local directory to be recreated remotely via FTP."

selengkapnya silahkan cek di sini

Semoga membantu, ;)

Edited by EVA-00 on 30-01-2013 14:43

Posted by letsmove on 30-01-2013 15:58
#3

kalo ga pake ftp class bisa ga bro. soalnya ip 192.168.6.5/exceldir/ nya hasil dari windows share directory dan full access. jadi bisa ngecreate file langsung. mohon petunjuknya.... :hlp

Posted by EVA-00 on 30-01-2013 19:50
#4

CI belum bisa cross domain / ip address, salah satu cara buat ngakalinnya ya pake FTP class.

or coba akalin bgini, 192.168.6.5/exceldir/ di mapping drive ke server 192.168.6.4 nah dari situ kan bisa bikin full path, btw OS server 192.168.6.4 apa?

Posted by letsmove on 30-01-2013 20:12
#5

nah. ini sebenernya udah di mapping. jadi 192.168.6.5\exceldir\ berada di drive z:\ dan bener bener full access. bisa ngecreate file dari exporernya langsung..

os pake windows server..


:hlp

Posted by EVA-00 on 30-01-2013 21:13
#6

lho, kalo udah bisa di map drive gampang bro, tinggal edit httpd.conf bawaan apachenya, buka file httpd.conf trus cari baris

"<IfModule alias_module>"

dibawahnya tambahin script :

Alias /localhost/situslu/exceldir "z:/ exceldir"

lanjut cari baris kode ini

#
# "C:/xampp/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "C:/xampp/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>


tepat dibawahnya sisipin kode ini

<Directory "Z:/exceldir">
AllowOverride All
Order allow,deny
allow from all
</Directory>


Restart apache, coba akses http://192.168.6.4/situslu/exceldir bisa kebuka ga???

kalo bisa, nanti kode CI di bagian pathnya jadi : $docPath = '"\\localhost\situslu\exceldir\"

Selamat Mencoba, ;)