how to set permissions for cfftp getfile from coldfusion code? - coldfusion

I am using and getting a file from ftp server. But when I use to read the downloaded file, its not allowing me to read the file. Its because of the permissions on the files.
How can i set permission to 777 or full access for that file from code. I don't want to do that manually. I am using Mac OS.
Thanks..

For setting permissions on a file in ColdFusion use the optional mode attribute of cffile with the octal values of UNIX chmod command.
<cffile action="write" destination="#fileToWrite#" mode=777>
This applies to Unix/Linux only.
If this is about files uploaded to your server and you have access to your ftp admin / config files, then you probably would want to modify the upload mask to adjust permissions of the files uploaded.
If you download the files yourself manually, then you would have to put it in a folder where coldfusion at least has read access, or tell your ftp client to store the file accessible for cf.

You can write permissions using CFFILE. I don't think there is a way to do only that, but you could do it as part of a rename or move operation. Check the docs for more specifics on it.

Related

How to download file in Amazon S3 storage using only a unique id without subfolder name?

i want to download a file from Amazon S3 using only a certain unique id i can use from it's api, without using a folder or subfolder name. I created a folder/subfolder structure with hierarchy levels to organize the files.
The same of what I did in Google Drive API v3, regardless of which the folder or subfolder name or hierarchy level of folders the file was saved, i can download the file using only the fileid.
i haven't read yet about the file versioning docs since there are tons to read.
any help would greatly be appreciated. thank you.
You can't do this with S3. You need to know the bucket name (--bucket) and full key (--key) of the file you want to download. Since a given file can have multiple versions, you can also provide a version id (--version-id).

can not add file in aws s3 bucket using postman

I am trying to add a file in s3-bucket in my AWS account using postman. see below screenshot.
I pass Host in the header as a divyesh.vkinds.com.s3.amazonaws.com where divyesh.vkinds.com is my bucket name. and in Body I am giving file as index.html as file type like image below.
but it is giving me The provided 'x-amz-content-sha256' header does not match what was computed.
error. I searched for it but can't find anything.
Please check content-header. Add Content-Type as text/plain and date in this format XX-XX-XXXX
I have also faced the same problem. The issue was that, postman does not calculate the SHA. It defaults to a SHA of empty string e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
So in the postman headers, add an explicit key x-amz-content-sha256. Caluclate the value of SHA256 for your file using a sha command and provide as the value. Below command works on linux flavors
shasum -a 256 index.html
Couple of other observations in the question.
You can change the Body as binary and choose the file you want to upload.
Provide the complete path including the file name in the upload URL. E.g. if you provide the URL as <your bucket name>.s3.<region>.amazonaws.com/test/index.html, the file will be copied to test directory in the bucket with name as index.html
I encountered this situation recently, and the issue was that I was copying an active log file which changed between when my side calculated the hash and when the file was actually uploaded. My solution was to copy the file to a temporary location, then upload that stable file.

Apache Superset permissions issue upload csv

Tried to upload a csv on superset installed in centos7. Gives an error message "erro no 13 permission denied on /app/superset/app/
chmod -R incubator-superset gave the necessary permissions recursively to folder-subfolder-files.
Not needed to restart the app as well
Which database are you trying to upload the CSV to? You cannot upload CSVs to the "main" or "examples" databases, to the best of my recollection. You'd have to connect another database of your own.
Once you have a viable database selected, you have to edit the database and check the Allow Csv Upload box, as well as make some changes in the Extra section as per the instructions you see right below that input.

Upload a file to a server

I want the user to upload files to server.
In the destination path of cffile I am giving it as \servername\folder\filename.
However, it doesn't recognize this path. Any suggestions?
don't you need two leading slashes for a UNC path?
\\servername\path\to\file\
in your example you only have;
\servername.....
Otherwise, as other have suggested it might be a permissions error.
I have only just been using CFFILE yesterday and today, using a UNC path to the server.
Also, what OS is the server, there are some oddities sometimes when trying to attach to a MS-Server. Eg. If you;re using a fully qualified domain name for SERVERNAME, try just the computer name. Or vice-versa...

Upload txt file to server

I want create a form to upload files (txt, xls) to the server, not the database.
Does anyone kown any example showing how I can do this?
In order to get the file on to the database server's file system, you would first have to upload the file to the database which it sounds like you are already familiar with. From there, you can use the UTL_FILE package to write the BLOB to the database server's file system.