Yii Framework Forum: Yii Get Data From Local Drive - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii Get Data From Local Drive Rate Topic: -----

#1 User is offline   deyelicious 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 21-March 13

Posted 21 March 2013 - 04:33 AM

i wonder, can yii get data from local drive?
for example, my yii is in C drive
htdocs/myprojectyii/
and i want get image from drive E in
E:/images/myimage.jpg

i've been tried this solution
<?php $path = 'file:///E:/images/myimage.jpg'?>
		<img src="<?php echo $path ?>" width="100" height="100"/>

but there's error
Not allowed to load local resource:file:///E:/images/myimage.jpg

0

#2 User is offline   msoa 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 258
  • Joined: 15-August 12

Posted 21 March 2013 - 04:44 AM

Try this path:
file://E:/images/myimage.jpg

Of course it may only work in Firefox. More
0

#3 User is offline   outrage 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 313
  • Joined: 10-November 09
  • Location:Blackpool, United Kingdom

Posted 21 March 2013 - 07:12 AM

You could create a virtual host to your images folder.
0

#4 User is offline   deyelicious 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 21-March 13

Posted 21 March 2013 - 08:14 PM

@msoa: your answer just like what i already do
@outrage: virtual host?could you explain to me?
0

#5 User is offline   msoa 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 258
  • Joined: 15-August 12

Posted 21 March 2013 - 09:48 PM

View Postdeyelicious, on 21 March 2013 - 08:14 PM, said:

@outrage: virtual host?could you explain to me?

outrage order is that you have to place your files in a location to be seen with the web server. meaning the web server have authorization to access the files location.

Creating virtual hosts on Apache 2.2
Also there are very tutorials on the Internet.
0

#6 User is offline   deyelicious 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 21-March 13

Posted 21 March 2013 - 10:47 PM

@msoa: i've tried it but i can't connect to my localhost.
0

#7 User is offline   msoa 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 258
  • Joined: 15-August 12

Posted 21 March 2013 - 11:34 PM

View Postdeyelicious, on 21 March 2013 - 10:47 PM, said:

@msoa: i've tried it but i can't connect to my localhost.

Did you restart Apache after the changes(can do this forom Service Manager)? Also i think you have to restart Windows Network Service. I'm not very familiar with Windows, for simplicity restart your system and try again.
Don't for get You should get a response from the Loop-Back address, like this:

PS C:\Users\TMP> ping 127.0.0.1 -n 3

Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:
    Packets: Sent = 3, Received = 3, Lost = 0 (0%
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users