Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Any way to upload image to an S3 bucket through ExtendScript?

Explorer ,
Aug 22, 2022 Aug 22, 2022

In Javascript, to upload files to an S3 bucket, aws-sdk is used. However, I can not import this library in Extendscript. So is there any way for me to perform this operation?

TOPICS
Actions and scripting , SDK , Windows
932
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Aug 22, 2022 Aug 22, 2022

Build c++ app/exe/python and then do

 

system("myApp.exe" --data "data")
and do it outside photoshop. 

Translate
Adobe
Engaged ,
Aug 22, 2022 Aug 22, 2022

Build c++ app/exe/python and then do

 

system("myApp.exe" --data "data")
and do it outside photoshop. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 22, 2022 Aug 22, 2022

I just did system("calc.exe"); in a blank jsx file to test it and it totally works.

That's so incredibly awesome!!! You've given me a whole world of options to explore and play with.

Thank you thank you thank you so much!

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 22, 2022 Aug 22, 2022

Sorry but could you elaborate more on the building the app part? What will the app contain?

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 23, 2022 Aug 23, 2022

I built a python exe containing the following code:

 

from photoshop import Session

with Session() as ps:
ps.app.activeDocument.name = "1"

 

If I run it using system("test.exe"), it does nothing. Why?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 22, 2022 Aug 22, 2022

You can call either Cyberduck or cURL via command line, both support AWS. On the Mac its fairly straightforward, on Windows I have sample code to use Windows Scripting Host and Powershell to run a cURL script silently (no ugly command window.) You can find this on my Dropbox https://www.dropbox.com/sh/mg817g9a9ymbasi/AADTmXUVxmFfM58bcyYE7yiwa?dl=0

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 22, 2022 Aug 22, 2022

Worth mentioning to anyone reading that there is a base64 conversion tool in Lumigraphics's toolkit as well... Which is pretty -word redacted- awesome!

 

@Lumigraphics Are you referring to the zip tool but then modified using curl/cyberduck instead of archive etc.

Or is there a silent cURL script jsx tool already in there and I'm not seeing it?

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 23, 2022 Aug 23, 2022

Yes you would call a Powershell script which calls cURL. Here is a sample (uploading to ftp but the idea is the same.)

#Sample Powershell script to upload files to ftp using curl

#Notes: File paths and directories should be edited to suit. Script will fail around 1400 files in a folder, keep it under that.
#If a different ftp account is needed, add a new item to the array with login:pass
#--ssl -k used for ftps account

#edit these variables
$curlpath = "~\curl\bin\curl.exe"
$MasterDir = "~\Pictures\"
$ftpDir = "ftps://ftp.sample.com/"
#subdirectories, logins, file types - (local folder, remote folder, file extension, file type)
$DirArray = ("PDF", "pdf/", ".pdf", "PDF"), ("Small JPEG", "JPEG/1000px/", ".jpg", "JPEG"),`
("Large JPEG", "JPEG/1600px/", ".jpg", "JPEG")
$ArrayCounter = 0
#add item to array for account with different password
$pass = "user:password"

#spreadsheet
$ftp = $ftpDir+"Excel/"
$filelist = "sample.xlsx"
cd ~\Desktop\
Start-Process -FilePath $curlpath -ArgumentList "-T $filelist $ftp -u $pass --ssl -k"

#repeat until end of DirArray
while ($ArrayCounter -lt $DirArray.length)
{
#get parameters for next directory
$Dir = $MasterDir+$DirArray[$ArrayCounter][0]
$RemoteDir = $DirArray[$ArrayCounter][1]
$searchext = $DirArray[$ArrayCounter][2]
$filetype = $DirArray[$ArrayCounter][3]
#if needed for different account
#$pass = $DirArray[$ArrayCounter][4]

#get file listing filtered by $searchext and convert to globbed input for curl
$filelist = dir $Dir ("*"+$searchext)
$filelist = $filelist -replace($searchext,',') -replace ($filetype,"")
$filelist = "{"+$filelist+"}"
$filelist = $filelist -replace(',}',('}'+$searchext)) -replace (' ','')

#launch curl if list is not empty, upload from local directory
if ($filelist -ne "{}")
{
#specify ftp server directory
$ftp = $ftpDir+$RemoteDir
#change local directory
cd $Dir
Start-Process -FilePath $curlpath -ArgumentList "-T $filelist $ftp -u $pass --ssl -k"
}
$ArrayCounter = $ArrayCounter+1
}

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 24, 2022 Aug 24, 2022

Regarding aws s3, where would the access key and secret access keys go? Could you help modify this code for aws?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 24, 2022 Aug 24, 2022
LATEST

Nope, I don't use Amazon services. I'd post on Amazon forums.

https://repost.aws/questions/QUYzA4Xr89RTKYL1uZ2C3qvg/aws-cli-uploading-files-with-curl

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines