Jump to content


Photo

Copying a file


  • Please log in to reply
8 replies to this topic

#1 VTS

VTS
  • Members
  • PipPipPip
  • Advanced Member
  • 72 posts
  • LocationTennessee

Posted 22 June 2006 - 08:08 PM

I have been trying to copy a file using php but for some reason, I cannot copy a file from a drive on the network to my c drive using the copy function. I can copy files from one place on my c: to another place on my c: but as soon as I try to copy a file from a network drive it tells me the file does not exist.

The only thing I could think to do was to find a workaround for this by using javascript to copy the file to my c: so I can use it. The problem I have is that I dont know how to imbed javascript into my php. If anyone could give me some ideas on how to fix the problem with not being able to copy from a network drive or how to imbed javascript into my php I would greatly appreciate it.

#2 jvrothjr

jvrothjr
  • Members
  • PipPipPip
  • Advanced Member
  • 300 posts
  • LocationOhio

Posted 22 June 2006 - 08:23 PM

[!--quoteo(post=386952:date=Jun 22 2006, 04:08 PM:name=VTS)--][div class=\'quotetop\']QUOTE(VTS @ Jun 22 2006, 04:08 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I have been trying to copy a file using php but for some reason, I cannot copy a file from a drive on the network to my c drive using the copy function. I can copy files from one place on my c: to another place on my c: but as soon as I try to copy a file from a network drive it tells me the file does not exist.

The only thing I could think to do was to find a workaround for this by using javascript to copy the file to my c: so I can use it. The problem I have is that I dont know how to imbed javascript into my php. If anyone could give me some ideas on how to fix the problem with not being able to copy from a network drive or how to imbed javascript into my php I would greatly appreciate it.
[/quote]

if you are using apache/php apache dont like to work with mapped drives basiclly because apache starts as a server before mappings are set...... there for does not see the mappings.
If you understand everything you know nothing!

http://rcchjr.awardspace.com/

#3 VTS

VTS
  • Members
  • PipPipPip
  • Advanced Member
  • 72 posts
  • LocationTennessee

Posted 22 June 2006 - 08:27 PM

Thanks for the info and yes, I am using apache. So I guess this means that I have to use the javascript then. Anyone know how to imbed that into my php?

#4 Eric_Ryk

Eric_Ryk
  • Members
  • PipPipPip
  • Advanced Member
  • 104 posts

Posted 22 June 2006 - 08:30 PM

[!--quoteo(post=386967:date=Jun 22 2006, 04:27 PM:name=VTS)--][div class=\'quotetop\']QUOTE(VTS @ Jun 22 2006, 04:27 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Thanks for the info and yes, I am using apache. So I guess this means that I have to use the javascript then. Anyone know how to imbed that into my php?
[/quote]How exactly would you plan to use javascript to copy a file? I think you are overestimating its ability.

#5 jvrothjr

jvrothjr
  • Members
  • PipPipPip
  • Advanced Member
  • 300 posts
  • LocationOhio

Posted 22 June 2006 - 08:31 PM

[!--quoteo(post=386967:date=Jun 22 2006, 04:27 PM:name=VTS)--][div class=\'quotetop\']QUOTE(VTS @ Jun 22 2006, 04:27 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Thanks for the info and yes, I am using apache. So I guess this means that I have to use the javascript then. Anyone know how to imbed that into my php?
[/quote]


I use a round about way with FTP running on a logged in user.

I just create a FTP User ID that was rights to that mapped network drive and copy the files via FTP to get to that network drive.

In my case I only have three subfolder so I have three Id's.........

This was my workaround but the machine that runs the FTP server has to be logged in and not started as a serve but started as a program after login....


If you understand everything you know nothing!

http://rcchjr.awardspace.com/

#6 VTS

VTS
  • Members
  • PipPipPip
  • Advanced Member
  • 72 posts
  • LocationTennessee

Posted 22 June 2006 - 08:52 PM

Thanks for the help once again jvrothjr! I think If possible I will try the javascript but if that doesnt work out, I will consider what you use as a workaround.




[!--quoteo(post=386970:date=Jun 22 2006, 03:30 PM:name=Eric_Ryk)--][div class=\'quotetop\']QUOTE(Eric_Ryk @ Jun 22 2006, 03:30 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
How exactly would you plan to use javascript to copy a file? I think you are overestimating its ability.
[/quote]

Well I found a script when I was looking on google that is supposed to use javascript to copy a file from one location to another. This was what I found:

<!--
myActiveXObject = new ActiveXObject("Scripting.FileSystemObject");
file = myActiveXObject.GetFile("c:\\test.txt");
file.copy("d:\\test.txt", true);
// -->


#7 Eric_Ryk

Eric_Ryk
  • Members
  • PipPipPip
  • Advanced Member
  • 104 posts

Posted 22 June 2006 - 09:19 PM

That's part of ActiveX, which only works in internet explorer, and sometiems ActiveX is disabled so it doesn't even work there.

#8 VTS

VTS
  • Members
  • PipPipPip
  • Advanced Member
  • 72 posts
  • LocationTennessee

Posted 22 June 2006 - 09:30 PM

Hmm...well I guess that kinda kills javascript. I guess I will have to try to use the workaround that jvrothjr uses unless you have any suggestions. Thanks for the replies guys.

#9 Eric_Ryk

Eric_Ryk
  • Members
  • PipPipPip
  • Advanced Member
  • 104 posts

Posted 22 June 2006 - 09:55 PM

[!--quoteo(post=386992:date=Jun 22 2006, 05:30 PM:name=VTS)--][div class=\'quotetop\']QUOTE(VTS @ Jun 22 2006, 05:30 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Hmm...well I guess that kinda kills javascript. I guess I will have to try to use the workaround that jvrothjr uses unless you have any suggestions. Thanks for the replies guys.
[/quote]
Might be able to use sockets.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users