I'm using cfftp to download files which I parse. I then need to delete the file from the server. I can list and download the files fine. However but I am butting my head against a problem that I can't seem to resolve.
Using the SAME PATH AND FILE NAME that allowed me to 'get' the file, I get an error when trying to remove it:
Error: 550 file: No such file or directory
Again, the path and file name used both times are identical. I thought it might be a permission problem, but I can delete files using Filezilla (same credentials) with no problem.
Here is the call to remove:
<cfftp action="remove"
connection="myConnection1"
passive="true"
timeout="360"
remotefile="#myPath##fileName#"
item="file" >
ANSWER (if not 'answer' - at least code that 'works')
<cfftp action="remove"
connection="myConnection1"
item="#myPath##fileName#" >
This is not what the docs say- or how other examples on line convey it - but this worked for me
Related
I have deployed my webapplication on a jetty server, and I am trying to edit those deployed files using WebStorm 8.0.4. But I am unable to save the edited files and getting the following error:
Try turning the 'safe write' feature (Settings/General, 'Use safe writes') off - does it help? It creates a temporary copy of a file: creates a separate temp file, deletes the original and then renames. With this option the original file permissions may be lost, this causes problems, especially when working on remote drives.
Follow these steps.
Open C:\Users\YourUserName\.m2\repository (If you use maven)
Find org folder and Navigate org\eclipse\jetty\jetty-webapp\yourJettyVersion
There will be a .jar file.
Open it with winrar or some program like winrar.
Navigate org\eclipse\jetty\webapp
Find webdefault.xml and Open it with any text editor.
Search useFileMappedBuffer parameter in file
You will see a param value.
Change it to false.
Save and Exit.
I'm sorry for any English mistakes.
We have a simple script that copies files across from a base install folder we created to house files for our application. When we choose to install a new site, based on these files, it's saying that the destination directory can't be found.
<cfset variables.destination = "#variables.base_path#\#variables.destination#\wwwroot\">
<!--- actually copying the base installation to the new location--->
<cfdirectory action="copy" directory="#mycontent.directory#\#mycontent.name#" destination="#variables.destination#" recurse="yes" >
<!--- end copying the system files --->
The wwwroot directory will always exist on the system. We are trying to push files into that folder. However it's throwing an error and won't allow it to go through.
The actual error message being caught is:
The specified directory C:\home\domainname.com\wwwroot\ could not be
created. The most likely cause of this error is that
C:\home\domainname.com\wwwroot\ already exists on your file system.
I tried the following in ColdFusion 11:
<cfdirectory directory="//users/myname/sites/test/source"
destination="//users/myname/sites/test/dest"
action="copy" recurse="yes">
This works fine, whether the folder has been previously created or not. Also, it seems that the recurse attribute is supported, despite the documentation only stating that it is valid for list and delete actions.
https://wikidocs.adobe.com/wiki/display/coldfusionen/cfdirectory
As it seems to happen some times but not others perhaps it is a timing issue or with large files / multiple folders?
I am beginning a project on Python that implements PyAIML and I wrote the following code to create a brain for my project:
import aiml
k=aiml.Kernel()
k.learn("std-startup.xml")
k.respond("LOAD AIML B")
k.saveBrain("jarvis.brn")
When I run the program I get this error: WARNING: No match found for input: LOAD AIML B
I understand that I needed to download an AIML set to begin development. So I did, but I'm stuck there.
Please help. I'm a noob programmer so don't be rough on me for this dumb mistake.
Thanks in advance!
The .learn() method will not throw an error if the file you pass it does not exist, and I'm guessing that you are trying to learn patterns from "std-startup.xml" without having this file in your directory.
Make sure the file std-startup.xml is in the directory you are running your script from. You should also have a directory called standard in your working directory that contains the standard set of aiml files. Basically your directory should look like this:
mydir/my_script.py
mydir/std-startup.xml
mydir/standard/a-bunch-of-std-aiml-files.aiml
These files can be found in the "Other Files/Standard AIML Set/" folder on the pyaiml source forge site. Go to that folder and download the one of the tarballs or the zip.
A few things:
If your AIML is loading properly, pyAIML will respond with a line that will read something like:
Loading std-startup.aiml... done (1.00 seconds)
It will not necessarily throw an error if it does not find a file to load, so if you don't see this line, pyAIML has not loaded the AIML file.
I don't see 'std-startup.xml' in the sourceforge directory either, but this shouldn't matter. All that you're loading is any AIML file that will allow you to test the kernel. Try loading the 'self-test.aiml' file in the /aiml directory instead. (Double-check to make sure the file suffix in your code is .aiml and not .xml)
k.respond() is for giving the bot some input and 'LOAD AIML B' is just a test phrase. Once you've loaded 'self-test.aiml' try k.respond('test date') and you should get
The date is Wed Mar 13 01:37:07 2013 in response.
If I try to list the files in an S3 directory using the built-in S3 integration in ColdFusion 9, I get an exception when any of the files contains a % (percent) character. The full error message looks like this:
An error occurred when performing a file operation listFiles on file
/activities/18057/files.
The cause of this exception was:
org.apache.commons.vfs.FileSystemException: Unknown message with code
"Invalid URI escape sequence "%ui"."..
I think this is a ColdFusion bug caused by overzealous character escaping, but can anyone with S3 integration try it themselves to confirm? I'm literally just doing this:
<cfset var files = directoryList("s3://my.bucket.path/somefolder/")/>
It works find for "normal" files, but fails as soon as one of the files has a % in its filename.
This would appear to be a "bug" in Adobe CF9 (ACF9). If it's not a bug, it's certainly odd behavior as I tried the code in Railo 3.3.3.0001 (current release) and it works perfectly.
I got the same error from ACF9 as you. In addition, ACF10 has the same error. I also tried in OpenBD but was not able to read the desired folder in my bucket (it read the main bucket, its files and listed the folder but was not able to get inside the folder). However, I've not used OpenBD a lot so this was probably more my error than anything else.
I'm trying to upload a file using PHP. My HTML page with the form is stored at
C:\wamp\www\myproject\upload.html
PHP page is
C:\wamp\www\myproject\upload.php,
and the file I'm trying to upload is
C:\wamp\www\myproject\openoffice.txt.
When I try to upload the file, I get the following error:
Warning: move_uploaded_file(/uploads/openoffice.txt) [function.move-uploaded-file]: failed to open stream: No such file or
directory in C:\wamp\www\myproject\upload.php on line 40
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\wamp\tmp\phpF66A.tmp' to '/uploads/openoffice.txt'
in C:\wamp\www\myproject\upload.php on line 40 Problem: could not move
file to destination directory
Here are lines 40-43 of upload.php:
if (!move_uploaded_file($_FILES['userfile']['tmp_name'], $upfile)) {
echo 'Problem: could not move file to destination directory';
exit;
}
The fact that it's looking in upload.php instead of the folder that it's in makes me wonder whether it's a server error or an issue with my PHP.
I Googled and got this advice but I don't know if it's the right advice, or how to implement it. Help?
You should be supplying a file system path for $upFile, not a web based path. try using the full system path to you your uploads directory like C:\path\to\uploads\openoffice.txt. Unless of course youre actually trying to place the file in C:\uploads...
Try this code
$imgName = time();
$imgPath = BASEPATH."../uploads/".$imgName;
$image = base_url().'uploads/'.$imgName;
move_uploaded_file($_FILES["file"]["tmp_name"],$imgPath.".jpg");
$imageNew =$imgName;
Where uploads is the folder name just rename it with your folder name or make your folder as name it as uploads. Its working code.
Thanks
Give your '/uploads/' folder where you are going to upload your file. 777 rights. Give full permission to that directory.