<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Dropzone Forums — Script to upload a file to FTP, wait and upload the next file]]></title>
	<link rel="self" href="https://forums.aptonic.com/feed/atom/topic/181" />
	<updated>2014-09-12T11:25:36Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.aptonic.com/topic/181/script-to-upload-a-file-to-ftp-wait-and-upload-the-next-file/</id>
		<entry>
			<title type="html"><![CDATA[Re: Script to upload a file to FTP, wait and upload the next file]]></title>
			<link rel="alternate" href="https://forums.aptonic.com/post/549/#p549" />
			<content type="html"><![CDATA[<p>Hi Alan,</p><p>I&#039;ve made you a custom version of the FTP action that waits 8 minutes between uploads. If you need to change the delay, you can edit the ftp_custom.rb file inside the action bundle and change line 96. The trick was there&#039;s another library bundled with Dropzone that does the actual uploading so I&#039;ve made you a custom version of this lib and bundled it along with the action.</p><p>You can download the action here: <a href="http://shipsomecode.com/misc/FTP%20Upload%20With%20Delay.dzbundle.zip">http://shipsomecode.com/misc/FTP%20Uplo … bundle.zip</a><br />Unzip it and double click the &quot;FTP Upload With Delay.dzbundle&quot; action bundle to add it to your grid.</p>]]></content>
			<author>
				<name><![CDATA[John]]></name>
				<uri>https://forums.aptonic.com/user/2/</uri>
			</author>
			<updated>2014-09-12T11:25:36Z</updated>
			<id>https://forums.aptonic.com/post/549/#p549</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Script to upload a file to FTP, wait and upload the next file]]></title>
			<link rel="alternate" href="https://forums.aptonic.com/post/548/#p548" />
			<content type="html"><![CDATA[<p>I had a little play and have a script based on the standard FTP one but when I add three small files it doesn&#039;t wait between files so not sure where I need to pause in the loop (so to speak).</p><p># Dropzone Action Info<br /># Name: FTP Upload Copy<br /># Description: Allows files to be uploaded to a remote FTP server. <br /># Handles: Files<br /># Creator: Aptonic Software<br /># URL: <a href="http://aptonic.com">http://aptonic.com</a><br /># OptionsNIB: ExtendedLogin<br /># Events: Dragged, TestConnection<br /># KeyModifiers: Option<br /># SkipConfig: No<br /># RunsSandboxed: Yes<br /># Version: 1.0<br /># MinDropzoneVersion: 3.0</p><p>$host_info = {:server&nbsp; &nbsp; =&gt; ENV[&#039;server&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :port&nbsp; &nbsp; &nbsp; =&gt; ENV[&#039;port&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :username&nbsp; =&gt; ENV[&#039;username&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :password&nbsp; =&gt; ENV[&#039;password&#039;]}</p><p>def dragged<br />&nbsp; delete_zip = false<br />&nbsp; <br />&nbsp; items = $items<br />&nbsp; <br />&nbsp; $dz.begin(&quot;Starting transfer...&quot;)<br />&nbsp; $dz.determinate(false)<br />&nbsp; <br />&nbsp; remote_paths = <a href="http://FTP.do">FTP.do</a>_upload(items, ENV[&#039;remote_path&#039;], $host_info)<br />&nbsp; # ZipFiles.delete_zip(items) if delete_zip<br />&nbsp; <br />&nbsp; # Put URL of uploaded file on pasteboard<br />&nbsp; finish_text = &quot;Upload Complete&quot;<br />&nbsp; <br />&nbsp; if remote_paths.length == 1<br />&nbsp; &nbsp; filename = remote_paths[0].split(File::SEPARATOR)[-1].strip<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if ENV[&#039;root_url&#039;] != nil<br />&nbsp; &nbsp; &nbsp; slash = (ENV[&#039;root_url&#039;][-1,1] == &quot;/&quot; ? &quot;&quot; : &quot;/&quot;)<br />&nbsp; &nbsp; &nbsp; url = ENV[&#039;root_url&#039;] + slash + filename<br />&nbsp; &nbsp; &nbsp; finish_text = &quot;URL is now on clipboard&quot;<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; url = filename<br />&nbsp; &nbsp; end<br />&nbsp; else<br />&nbsp; &nbsp; url = false<br />&nbsp; end<br />&nbsp; sleep 600<br />&nbsp; $dz.finish(finish_text)<br />&nbsp; $dz.url(url)<br />end</p><p>def test_connection<br />&nbsp; <a href="http://FTP.test">FTP.test</a>_connection($host_info)<br />end</p>]]></content>
			<author>
				<name><![CDATA[AlanJ]]></name>
				<uri>https://forums.aptonic.com/user/414/</uri>
			</author>
			<updated>2014-09-11T14:17:00Z</updated>
			<id>https://forums.aptonic.com/post/548/#p548</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Script to upload a file to FTP, wait and upload the next file]]></title>
			<link rel="alternate" href="https://forums.aptonic.com/post/547/#p547" />
			<content type="html"><![CDATA[<p>Hi,</p><p>I have just purchased DropZone as it looks like a nice programme and I love the idea of the scripting options.</p><p>I have been looking at the FTP script as what I am trying to create is a script that uploads a file to a ftp server, waits 5 minutes and then starts the next transfer.&nbsp; Its important that it only uploads one file at a time and then waits long enough for the script on the other end to start processing.</p><p>Can I simple add some kind of pause to the default script?</p><p>Anyone got any ideas or suggestions?</p><p>Alan</p>]]></content>
			<author>
				<name><![CDATA[AlanJ]]></name>
				<uri>https://forums.aptonic.com/user/414/</uri>
			</author>
			<updated>2014-09-11T13:54:55Z</updated>
			<id>https://forums.aptonic.com/post/547/#p547</id>
		</entry>
</feed>
