GetRemoteFile方法问题-无法从长URL下载照片
正如标题所说,我正在尝试从不同的URL下载照片。但当我注意到URL太长时,就会出现问题,然后无法下载(可能是当其长度超过256?)。谁能帮我解决这个问题?是否有一些功能可以帮助我从大URL下载照片?我尝试使用RenderMan的GetFileURL,我将其附加在下面。
- (defun GetFileURL (url path / utilObj tempPath newPath)
- ;; © RenderMan 2011, CADTutor.net
- ;; Example: (GETFILEURL "https://damassets.autodesk.net/content/dam/estore/customer-service/AutoCAD_Shortcuts_11x8.5_MECH-REV.pdf" (getvar 'dwgprefix))
- (vl-load-com)
- (setq utilObj (vla-get-utility (vla-get-activedocument (vlax-get-acad-object))))
- (if (= :vlax-true (vla-isurl utilObj url))
- (if (vl-catch-all-error-p
- (vl-catch-all-apply
- 'vla-GetRemoteFile
- (list utilObj url 'tempPath :vlax-true))
- )
- (prompt "\n <!> Error Downloading File From URL <!> ")
- (progn
- (if (findfile
- (setq newPath
- (strcat path
- (vl-filename-base url)
- (vl-filename-extension url))))
- (vl-file-rename
- newPath
- (setq voidPath
- (strcat
- (vl-filename-directory newPath)
- "\\void_"
- (vl-filename-base newPath)
- "_"
- (menucmd
- "M=$(edtime,$(getvar,date),YYYY-MO-DD-HH-MM-SS)")
- (vl-filename-extension newPath)))))
- (vl-file-copy tempPath newPath)
- (vl-file-delete tempPath))
- )
- (prompt "\n <!> Invalid URL <!> "))
- (vl-catch-all-apply 'vlax-release-object (list utilObj))
- (princ)
- )
|