FM/FTP FileDrop One File Type Only - Forum

Forum Navigation
You need to log in to create posts and topics.

FM/FTP FileDrop One File Type Only

I want to copy only PDF files from one browser to another by drag and drop. If I drag multiple files where one of them is not a PDF I can cancel the whole drop easy enough. But I can't seem to be able to filter out the the non-PDF files and still copy just the PDFs. Here is what I've tried so far:

:FMFTP_DropFile
fmSetDelimiter ";"
StrParse "[FMFTP.EventSourceFile]" ";" "[filecount]" "[filecount]"

Loop "1" "[filecount]" "[filecountloop]"
ExtractFileExt "[filecount[filecountloop]]" "[pdfYN]"
If "[pdfYN]" "<>" ".pdf"
SetVar "[filecount[filecountloop]]" ""
EndIf
EndLoop
Loop "1" "[filecount]" "[filecountloop]"
SetVar "[FMFTP.EventSourceFile]" "[FMFTP.EventSourceFile];[filecount[filecountloop]]"
EndLoop
SubStr "[FMFTP.EventSourceFile]" "1" "1" "[SemicolonYN]"
If "[semicolonYN]" "=" ";"
StrDel "[FMFTP.EventSourceFile]" "1" "1" "[FMFTP.EventSourceFile]"
EndIf
StrReplace "[FMFTP.EventSourceFile]" ";;" ";" "[FMFTP.EventSourceFile]" ""

Return

This still copies the non-PDF files.

Suggestions?

I've come up with a partial solution.

If I understand the meaning of the variables correctly.

 

:FMFTP_DropFile
fmSetDelimiter ";" .Not necessarily if it doesn't change anywhere. This is the default value.
StrParse "[FMFTP.EventSourceFile]" ";" "[FileName]" "[count]"
Loop "1" "[count]" "[i]"
ExtractFileExt "[FileName[i]]" "[pdf]"
If "[pdf]" "=" ".pdf"
SetVar "[Temp]" "[Temp][FileName[i]];"
EndIf
EndLoop
SetVar "[FMFTP.EventSourceFile]" "[Temp]"
SetVar "[Temp]" ""
Return

 

@mishem

I don't think it lets me change the [FMFTP.EventSourceFile] variable. It keeps returning with my original selected files.

Thanks. I've figured out another option/solution using the ksDrop plugin.