Need help with Amazon S3 - Missing Parent Directory

Hi,

I am trying to copy a file to S3 drive but keeps getting the “missing
parent directory” error. There was a lengthy discussion on the railo group
https://groups.google.com/forum/#!msg/railo/pU21u57HMhU/g5-9AKRdWf0Jand
the bug seems to have been fixed by version 4.04. However, I keep getting
the same error with Railo 4.2.1 and Lucee 4.5. So the issue is likely my
code, but I have tried various combinations and still I can’t get it to
work:

filePath = “C:\image6.jpeg”;
accessKeyId = “XXXXXXXXXXXXXXXXXX”;
awsSecretKey = “yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy”;
bucketName = “mybucket”;
fileDestination = “s3://” & accessKeyId & “:” & awsSecretKey & “@” &
bucketName & “/image6.jpeg”;

fileCopy( filePath, fileDestination );

I have also tried these:
fileDestination = “s3://” & accessKeyId & “:” & awsSecretKey & “@s3.amazonaws.com/” & bucketName & “/image6.jpeg”;
fileDestination = “s3://” & accessKeyId & “:” & awsSecretKey & “@us-west-2/” & bucketName & “/image6.jpeg”;

I have also put the keys in Application.cfc and just do:
fileDestination = “s3://” & bucketName & “/image6.jpeg”;

But none of them works. What am I missing?

Thanks,
ML

I have also run into issues with defining the accessKey and SecretKey in
the file destination. Adding them in the Application scope helped fix
those. Your code looks ok, although I use this to write to it:
file action=“write” file=“#fileDestination#” output=“#binContent#”
nameconflict=“overwrite”;

Also, make sure your bucketname on s3 is public, so you can see your
resources through a browser once you upload them. I also give the uploaded
file the correct properties after the save:
<cfset storeSetACL(
loc.s3File,
[
{
group=“all”,
permission=“read”
},
{
id=“#APPLICATION.settings.canonical_user_id#”,
permission=“full_control”,
displayName=“”
}
]
) />

Bump! I’m also having this issue… Has anyone found any solutions… I’m on
the verge of writing a wrapper for the S3 Java API…

AdamOn Tuesday, March 31, 2015 at 1:06:30 AM UTC+11, Evagoras Charalambous wrote:

I have also run into issues with defining the accessKey and SecretKey in
the file destination. Adding them in the Application scope helped fix
those. Your code looks ok, although I use this to write to it:
file action=“write” file=“#fileDestination#” output=“#binContent#”
nameconflict=“overwrite”;

Also, make sure your bucketname on s3 is public, so you can see your
resources through a browser once you upload them. I also give the uploaded
file the correct properties after the save:
<cfset storeSetACL(
loc.s3File,
[
{
group=“all”,
permission=“read”
},
{
id=“#APPLICATION.settings.canonical_user_id#”,
permission=“full_control”,
displayName=“”
}
]
) />