When copying an image from the Juniper downloads site (https://support.juniper.net/support/downloads/) directly to the device using an URL the following syntax must be followed:
file copy "<URL>" /<local_path>
Example:
file copy "https://cdn.juniper.net/software/junos/21.4R3/junos-install-srx5000-x86-64-21.4R3.15.tgz?SM_USER=&__gda__=1700060920_aa73ecc9c27ea1d74ae600a2bc423ac4" /var/tmp/junos-install-srx5000-x86-64-21.4R3.15.tgz
The URL must be in between quotes and the destination on the local filesystem must be specified right after specifying the URL (source) otherwise a syntax error may be seen and the image will not be successfully downloaded.