How to remove a specific repeatedly uploaded file?

If you have a new question you’d like our support staff to post a response to, please visit our customer community, GoAnywhere Insiders, to pose the question in our Discussion Boards. We have a thread “Ask Our Tech Experts” that our support team monitors on a regular basis, or you can start a new discussion where other GoAnywhere users and support staff can weigh in. Log in or create your new account at https://insiders.goanywhere.com.

If you need an immediate response, please create a support ticket or contact our support team by email at [email protected].
2 posts Page 1 of 1

draymer

Posts: 1
Joined: Wed Apr 25, 2018 4:13 pm

Post by draymer » Thu Nov 01, 2018 11:39 am
We have a client that keeps uploading a Thumbs.db file every 5 minutes and it creates a ton of triggers. They also upload additional files periodically so I can't quite ignore it, but I want to the project to delete the Thumbs.db file every single time they upload before it even goes thru the rest of the project to push the files to another location.

I tried doing this but it bombs out with "ERROR [8099 - Create File List] An unexpected error occurred. Variable not found: Thumbs.db" and I'm a little confused:
Code: Select all
		<createFileList fileListVariable="files" version="1.0">
			<fileset dir="/path/to/inbound/" recursive="false" sortedBy="name" sortOrder="ascending">
				<wildcardFilter>
					<include pattern="*" caseSensitive="false" />
				</wildcardFilter>
			</fileset>
		</createFileList>

		<if label="If Thumbs.db File" condition="${files eq Thumbs.db}">

			<delete label="Delete Thumbs.db file" file="/path/to/inbound/Thumbs.db" version="1.0" onError="continue" />

			<else>
I know this is going to be a simple solution but it's driving me crazy trying to get this working. Thanks

Support_Andy

Posts: 7
Joined: Thu Feb 16, 2017 11:03 am

Post by Support_Andy » Tue Dec 18, 2018 12:02 pm
There are several ways to handle these unwanted files. Attached is a basic project that lists out the directory and then uses a For Each Loop to loop through each file looking for a file named ‘thumbs.db’, if it detects the file it deletes it. You can then use the else condition to do your normal tasks in the project.
Note: Project XML attachments are not valid on every version of GoAnywhere
This attachment was created in version 5.7.7
Delete a thumbs db file.xml
Delete a thumbs db file
(608 Bytes) Downloaded 304 times
2 posts Page 1 of 1