Copy Files To A Different Dir?
I have a file which is located in "/usr/home/coreyr/html_files" and I want to copy it to "/usr/home/public/html" I've tried the following and I receive errors.
<?php copy('sf.html', '/usr/home/public/html'); ?>
any ideas?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Creating Dir, Copy Files And Pass Variables To 2 Files
I need to create a folder on the server weekly named by the user. To this folder copy the contents of an /Original folder. Inside the new folder edit one of the files to insert a data with a XML path generated in another application, copied (via memory) and pasted within the very first form and passed to the file in question. <param name="FlashVars" value="xmlfile= $lanofile" /> the $lanofile is the value that I need to pass from the form to be read by this file. I have created an form (n.php) that POST the name of the folder to a second file (creatdir.php) everything is cool until I have to edit the third file. How can I pass the value of one of the formfileds to a second file and them read this value as a variable to be consumed as mentioned above? Or actually right whatever is on the third field to this position (not using variables).
Copy Files From Remote URL
how can I copy a file from a url into the directory where my php file is located? On the server I use it is not possible to use the copy() function for this task.
Copy Files And Folders
Assuming you had a template folder and files on the webspace and you wanted to make a exact copy/rename of it with a username and password being the one and only difference - how would one do it ? . (the difference being a password protected folder)
Copy Files And Folders From One Directory Into Another
I have files in myurl.com/myfolder and I would like to copy all of them into myurl.com/newfolder I'd like to copy all of the subdirectories and files that are in /myfolder and I would like to be able to use a form of some sort to name the file I want to copy, and create the folder I'd like to copy it to, such as newfolder. How can I use a form to create a new folder on the server? How can I use a form to name the old folder I want to copy everything from, then create the name of the new folder I want to copy everything into, and then copy?
Copy()
I'm trying to get this image upload function to work, and I'm stuck at a seemingly simple problem I can't solve. Here's the file with everything all-inclusive: Code:
Copy()
I am trying to copy an image to a directory. I got it working on its own, but can't get it working in the shopping cart admin area. any thoughts?
Copy Everything Between X And Y?
I'm trying to do what I figure is the opposite of preg_replace. I need to copy everything between two constant/known words in a string, e.g $string = "I am going to the market to buy eggs and bacon for breakfast"; or $string = "I am going to the market to buy fruit for breakfast"; How can I get 'eggs and bacon', or 'fruit', or whatever else is in between 'buy' and 'for breakfast'?
No Copy
Does anyone know how to make it to where no one can right click and copy a bunch of important data off of you page?
Copy A File From A Different Url
Hi I am trying to copy a file froma different url but failing! I am trying - copy ("http://www.site.com/image.jpg" , "temp.jpg"); but getting an ' Unable to open 'http://www.olgaedwards.com/photos/2041.jpg' for reading: No such file or directory' error. Strange because it exists and - $file = fopen("http://www.site.com/image.jpg" , "rb"); works ok! I even tried - $file = fopen("http://www.site.com/image.jpg" , "rb"); copy ($file , "temp.jp"); But the same error.
Copy On Server
I think you haven't enough permission of your webserver is running. in iis an anoymous user is assigned when running a webserver. you need to change that user anoymous to a specific user and assigned that user in full permission to access your path. the system is running your php.exe ie php. so php.exe need to have full access to write or read that specific path. may be you havn't enough privilidge to read that path. check your systems security settings on this issue. apache2triad is a third party software i don't like to work in this env. try an exclusive machine and install php and webserver. Here is the code.....
Copy A String
Im trying write a script that will do this: I provide a directory location. The script scans all the files in a directory, oldest to newest. In each file it looks for the word [QUOTE]. It counts forward until it finds [/QUOTE]. Then it copies the counted characters. It opens a file titled quotes.txt and runs a scan to see if that particular quote is in there. If it is not, it pastes it. If it is, it drops that copied text and returns to the scan. Im a bit stuck on the copy part. Once I find the text, how do I copy it?
Problem With Copy
I don't understand why this script want work if($_POST['students'] == true) copy("$file" , "/students/$file_name") else echo "no check"; Parse error: parse error, unexpected T_ELSE
Copy From One Table To Another
I have some data in one mysql db table as such.... first_name | last_name | email | mail_type | gender | etc I'd like to copy it into another mysql db table, but in a different order..... id | email | first_name | last_name | gender | mail_type | etc How would I do this with php ? A loop inserting values or something ?
Move_uploaded_file() Vs Copy()
Aside from the diffrences referenced in php.net is there anything different between copy() and move_uploaded_file() that would somehow alter uploaded files, .jpgs especially? I have built an CMS that has worked fine for years. The public side is Flash. For certain reasons I have had to change my PHP to use move_uploaded_file() instead of copy(). Now any files I move with move_uploaded_file() make them unavailbe to Flash. When I check the server directories my .jpgs are where they are supposed to be and they are titled as expected. Also I am sure the uploaded .jpgs are not progressive.
Create/copy
what i want to do is have it when someone signs up it creates a folder with their username on the server and copyies files to that folder....
COPY Command
Currently, I have a routine with the file command, & a foreach loop to save the file (append) to another file.. HOWEVER.. I've come accross a situation where one of my 'source' files is over 17 Megs, & my script times out... (im not echoing anything to the screen / cron jobs...) QUERY1 :- I cant see anywhere if the copy command can APPEND to an existing file ? (or does it just 'copy' - & replace whatevers there ?) Is there any other way - that I can 'append' files together - without timing out ? - PS - im re-running the entire process from the start - (just in case) - to see if the file is still 17 megs (its compiled from 900- other files - a summary file)
Copy In 2 Directories
I've got a simple question. Is it possible with the command "copy" upload a file via browser on two different directories? I use copy copy("$file", "/directory1/$superdat_name")
Php Image Copy
I want to use php and copy remote images onto my server. Reason?, well the site they are hosted on doesn't want me to direct link to the images because it costs them bandwith so they want me to save and upload to my own server only problem is there's only a couple hundrer pictures lol... any way i can use image copy or something and copy the images to my server.
Copy A File With PHP
Im trying to copy a file from the root of my website to other folder.. $source='/home/content/maunalava/html/dev-netteampr/portales/index.php'; $destination=('/home/content/maunalava/html/dev-netteampr/portales/' . $usuario); copy($source, $destination); But I keep getting...failed to open stream: Is a directory in....
Copy Image
I'd like to copy a file, lock, stock and barrel to another location - copy, not move. I was just wondering whether there's an easy way to do this using PHP. The file is a JPG image if that helps, but it makes no difference to me how it gets copied provided that it works and I understand how it happens so that I can customise the code later if necessary.
Copy Folder?
I want to copy a folder, subfolder, files, and subfiles. I don't care about attributes. I thought about making the folder a zip, and then using extract but that was confusing and took too long on the server. so what do I do? Is there a script that will parse the dir and COPY all the files?
Copy Variable Name
I'm trying to create a script that creates sql insert statements dynamically. This script needs to handle several different arrays that are passed to it from various form validation scripts. The keys in these arrays are identical to the column names in their respective tables. What I need to do is somehow output the actual names of the keys to be used as the column names in the insert statement, and then output the actual values in the array as the values to be inserted. So I want to take an array like this: $bookarray = array ( 'booktitle' => 'Cat In The Hat', 'price' => '15.99' ); And end up with this: insert into books (booktitle, price) values ('Cat In The Hat', 15.99) Without knowing that the incoming keys were booktitle and price.
How To Copy An Entire Array?
can I do this? You see, I want to pass my values in to another page, but you can imagine how it would be insane to try and copy each value in the array individually <A HREF="thepage.php?array[0]=$array[0]&array[1]=$array[1]... etc is there a way to compress an array into a single variable, and then decompress it like: Code: $compressedArray = compress(0, 10, $array); where 0 is the start index, and 10 is the end index then when I want to use it on the other page Code: for ($x=0; $x<=10; $x++){ $newArray[$x] = decompressMe($x, $compressedArray); } I'm sure that there must be some simple little thing like that.... I looked at the php manual, but couldn't really see anything like I'm talking about (or maybe I dont understand it )
Copy Command Available In Windows?
Is the copy command available for use on a windows system. I have tried to run a script using it (taken directly out of a PHP manual) and am receiving a "parse error".
Copy/Paste Anomaly
Whenever I copy and paste code from my browser into my editor of choice, then upload it to my server, the code doesn't go in right. However, if I retype the exact same code and then save the file, upload it again, it works okay. But this defeats the purpose of copy/paste. Yes, I uploaded the file as ascii. No, there aren't any weird characters are codes that show up. I'm running MacOS 9.1 and Internet Explorer 5.0. I haven't tried copying and pasting the code on Netscape. Has anyone had this problem?
Directory Copy Question
I noticed that I can't remove the folder that I created because it says "Directory not empty" so I did a little investigation on my PC machine. I used telnet to get to my folders and did a ls -a and noticed that all of the files had an asterik on the end of them and it had a file called .gif* in there as well. So, when I deleted all the files in the folder it deleted all of them BUT the .gif* and thus I cannot delete the folder through ftp on my mac. whew!! Finally my question: Is this normal to have an asterik at the end of a file name when using a repetitive copy funtion like this? AND is there something wrong with my code that is forcing a file called .gif* to be created? Here is what I have: I am setting the variables prior to this function call. ----------------- Calling the function like this: getImages($sourceimagefolder,$imagepath); ------------------ Here is the function: (thanks to dusty2k by the way) function getImages($sourceimagefolder,$imagepath) { if ($handle = opendir($sourceimagefolder)) { echo "Source Directory: $sourceimagefolder<br><br>"; echo "Destination Directory: $imagepath<br><br>"; echo "Files:<br><br>"; while($file = readdir($handle)) { if($file != "." && $file != "..") { if(copy($sourceimagefolder . $file, $imagepath . $file)) { echo "$file copied successfully.<br>"; } } } closedir($handle); } }
Copy A File To The Server
is it possible to copy a certain given file from a set location to the server everytime the page is accessed? I have to build a site wehere daily new information has to uploaded to an intranet server, like new exchange rates. therefore i want to build a script that automaticaly uploads a csv-file to the server whenever it is accessed. the file that has to uploaded resides(and is updated) an a certain machine on the lan. is this possible? and how would you do it? PHP Code:
Copy($file, $address)
trying to use copy($file, $address) and it throws this back at me... Warning: open_basedir restriction in effect. File is in wrong >directory >in /home/sites/site170/web/admin/experiments/uploader.php on line 57 is this a permissions problem?
Copy Table Data To Another
I've been searching in the PHP forums for this answer, and I've found something similar, and have used to this to the problem I have. Anyway, when I do run this script I get an error line 5 which is the 'while' statement. $query_newsfeed = "SELECT itemid,heading,news_date,content FROM newsfeed"; $query1_exec = mysql_query ( $query_newsfeed ); // Error here! while ( $query_row = mysql_fetch_assoc ( $query1_exec ) ) { $query2 = "INSERT INTO newsfeed_map ( itemid,heading,news_date,content ) VALUES ( $query_row[$itemid],'$query_row[$heading]','$query_row[$news_date]','$query_row[$content]' )" $query2_exec = mysql_query ( $query2 ); Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource Any ideas where I could be going wrong?
Copy() Japanese Characters
I use copy() in the time of file uploading. but at the time of uploading the file name change to unreadable char( my file name is in japanese char). I use win xp japanese version and php 5. So how can i upload file and keep the file name unchange in japanese char.
JPG>GIF (resizing And Saving As Copy)
I was just wondering how I take a JPG file on the server, shrink it, and save it as a copy, and in GIF format? For example: I have a file called 'desktop.jpg', and I would like to shrink it to an image called 'desktop.gif' (based on the jpeg's name, so if it had been 'boat.jpg' it would be saved as 'boat.gif'), and resized to 120x96 pixels, and save the gif in the same directory. How do I do this?
PHP4/5 Deep Copy?
I've got a PHP4 app that I developed which I'm trying to get to run on a PHP5 server. Everything works great, except for one thing. There's a particular routine that creates an original object, then copies it. (The object constructor gets some meta information from the database, so I copy it for performance reasons). The routine then modifies the copies. PHP5 copies by reference by default, so this doesn't work--- I'm not modifying the copies, I'm modifying the original. I read about a trick to create a PHP4/PHP5 compatible clone function, but that doesn't work either. PHP5's clone is a shallow copy, so the properties of the original which are other objects only get referenced. // Start Example: class simple { var $key; function simple() {} } class cloneable { var $simple; function cloneable() { $this->simple = new simple(); } } $prototype = new cloneable(); $record1 = clone($prototype); $record1->simple->key='blue' $record2 = clone($prototype); $record2->simple->key='red' echo $record1->simple->key; echo $record2->simple->key; // End example In PHP4 (assume that the clone function has been defined to just return a copy of the original object) this code outputs "bluered". In PHP5 it outputs "redred". How do I deep copy an object in PHP5 the way PHP4's assignment operator works?
File Permissions After Copy()
This function basically creates a new dir in a determined location and copies the files from an established dir to the new dir. It copies the files and creates the folder ok, bit it sets the file permissons to 755 for the new folder and file contents. I then get a 550 error if I try to delete or chmod them. Any suggestions? I get permission errors in the script if I use the chgrp and chmod functions also. PHP Code:
Copy Of Zlib File
I goofed up my linux beater box at home and I need to reinstall. It seems that zlib is located at http://www.zlib.net, but that site isn't working. I was wondering if someone has a recent release they could e-mail.
Corrupt Images With Copy() ?
I am working on a greeting cards system and I have a function that adds new cards to a database and uploads the corresponding image in an images/cards/ folder (which is set at 777 so it's not a permissions problem...). I have an entry in the db with the filename, which is always the card's id plus its extensions (so all cards are named c_id.ext, and all thumbnails are named t_id.ext - example: c_55.jpg, i_55.jpg). The thing is... last week it was working fine. But now this morning I had a very unpleasant surprise. When I tried to add a new card, or upload a new image for an existing card, the image (both thumbnail and card images) is all screwy. It would add some weird lines, or take the first portion of the image and repeat it but with different hues, etc. Another really weird thing, is that when on my HD, the image was like 18k, and when on the server, it became 36k! Note that for a card update, I always delete the current card image first, then reupload a new one (normally copy() overwrites automatically, but if the extension is different - say the old one was a .gif and the new one a .jpg - the old file (.gif) would linger on the server). I haven't changed the script, and as far as I know, neither the Apache config nor the php.ini have been changed. The only changes to the server since last week was that we solved a qmail problem (nothing to do with it), and that it was down for a while this morning and we rebooted it (but before it went down it was already doing the screwy image problem). If I upload a file named c_id.ext by FTP and overwrite it, it's fine... doesn't change its size either. Even though I haven't changed anything at all in my image upload script, I assume the problem is in there (I use the copy() function as stated in the topic title), but what could it be? Is it something in Apache maybe? Here's my function for the image upload... Note that I have a MAX_FILE_SIZE hidden field so if the image is too large, it will automatically be empty (size=0). (Incoming variables are the $_FILE["image"] data, the directory where it's uploaded, and the new filename (w/o the extension yet) which is either "c_id" or "i_id": PHP Code:
Copy, Rename And Delete
i want a complex process of downloading files, for example if i have a file called "abc.zip" and its downloading link on my site is "www.domain.com/files/abc.zip". but when someone clicks on it i want to copy the same file to another folder and then rename it and place a condition on this that after 24 hours it should be deleted automatically.
Mysql Data Copy
I have mysql table1 on my local comp. It looks something like this. ---------------------------------------------------------------------------- - broj_tel | poruka | sifra | grad | id | ---------------------------------------------------------------------------- | +385912701600 0 Zprod rijeka 5 | ---------------------------------------------------------------------------- | +385912701699 1 kprod crikvenica 3 | ---------------------------------------------------------------------------- - On the remote server (web hosting) i have table2 looking something like this: ---------------------------------------------------------------------------- --------- id_independant | Name | Surname | broj_tel | poruka | ---------------------------------------------------------------------------- --------- | 11122 Martin Johnes +385912701600 1 | ---------------------------------------------------------------------------- ----------| 16163 John Doe +385912701699 0 | ---------------------------------------------------------------------------- ---------- Question: I nead periodicly (some scheduler, my concern) to make something like this: select * from table1 insert into table2 (poruka) whare table1.broj_tel = table2.broj_tel To read the data from table1, and inserts into table2 coloumn poruka whare tabel1.broj_tel i equal table2.broj_tel Problem is that the data is in diferent databases.
Copy String Between Tags
I'm doing an advanced html editor and when a user introduces an image, he introduces «img»/mysite/hello.gif«/img» I need to copy the string between «img» and «/img» to a variable. Anyone knows a function that do such a thing?
Chmod/copy() Code?
I'm trying to copy a file to a directory: $file = "./users/common/male_photo_na.gif"; $to = "./users/dir/"; chmod( $file, 0755); chmod( $to, 0755); copy($file, $to); And I keep getting: Warning: Unable to create './users/dir/': Permission denied in c:inetpubwwwrootdining est.php on line 12 what can i do to fix this??? thx...
PHP Copy To Local Machine?
I am building a small page to copy files from our server(s) to our users local machines. It's very simple... (below, "f" is a mapped network drive) <?php $source_file = 'f:somefile.whatever' $destination_path = (I want to move it to the USERS C:somedirectorysomefile); copy($source_file, $destination_path); ?>
File Copy Error
Here's a piece of code I'm running on my server though I keep getting the following error. I'm not too sure what might be the issue, however, I have the permissions set properly - though I doubt if I'm using the right folder paths. Cheers and regards, The Code:
Copy File From One Server To Another
How can I copy a file(s) from my server to another server? I trying to keep files on a develpment server current with a production servers files. So if i have files "a", "b", "c" on the production server, and files "b", "c" on the develpment server, i want to copy "a" from the production server. Is this possible? Also is it possible to upload a file to several destinations?
Copy()-problem Over A Network
I have a problem with accessing files on other computers in my network. The network is a Windows 2000 workgroup network and I have administrator rights.... This works (from the directory copytest I copy something to copytest2): <?php copy(ཁ_17340.jpg', 'D:copytest2 est.jpg'); ?> The next bit does not do the job (from the same directory to a networked one): <?php copy(ཁ_17340.jpg', 'V:copytest2 est.jpg'); ?> It gives me the following message: Warning: copy(V:copytest2 est.jpg): failed to open stream: Permission denied in D:localwebcopytestcopytest.php on line 2 (computernamesharename gives the same message).
Copy Auto_increment Value To Another Field
i want to create a unique serial number to my Db entries. I thought the best way would be to add the auto_increment primary key value to a string, then insert it into a table field 'serial_num'. $serial_num = "NAME000" . $auto_increment_value; Is this possible in one function? Or do I have to insert all the other data first, then get the last inserted id value and then update the entry with the $serial_num variable?
Copy Array From Php To Javascript
I'm trying to copy the contents of a numerically indexed php array ($menu) to a javascript array (javascriptmenu). I'm not too familiar with js. The only idea I had was to create an array in js and then set it equal to the php array: var javascriptmenu = new Array() var javascriptmenu = '.$menu.' I'm using the '..' because this block is already contained within single quotes. When I try to alert an item in the array javascriptmenu: alert(javascriptmenu[0]) I get this message: Quoteundefined Am I doing something wrong, or is this just not possible?
|