Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Function only works after exporting file ???

Featured Replies

Hello

Filemaker Version: Filemaker Pro Adv 11 v.02

Something strange is going on, and my skills do not alow me to understand whats going on.

Replace the "Zip File" function in the Scriptmaster.fp7 file with the function below.

Then add a second container field into the Demo table. do "Insert File" on this container. Choose the any :P file.

This new container is your "src" parameter. Run the function, and it works perfectly. The function save the contants of the container as a temporary file, and returns its path.

Problem:

When I register this function at startup with my own filemaker file, then it can ONLY be used when I export(once per filemaker session)some container field in the database first. The database must be the one where I want to use the function. If i do not export some field, then the function will return an error.

As soon as I export something, the function works, for the rest of the session. You could sya that "export content" is a trigger that allows my function to work.

Well this sucks :

InputStream srcIn;

String srcName;



if (src == null) throw new IllegalArgumentException("no src file was specified");

if (src.indexOf("::") != -1) {

	// this is a field name in filemaker, not a path

	srcIn = fmpro.getContainerStream(src);

	srcName = fmpro.getContainerFileName(src);

} else {

	File f = new File(src);

	if (!f.exists()) throw new FileNotFoundException(f.getAbsolutePath());

	if (!f.isFile() || !f.canRead()) throw new IOException("File " + f + " is not a normal file, or cannot be read");

	srcIn = new FileInputStream(f);

	srcName = f.getName();



}







try {

	File d ;

	if (destination == null || destination.length() == 0) {

	//	d = File.createTempFile("scriptmaster_zip_", ".zip");

		d = new File(System.getProperty("java.io.tmpdir"));		



	} else {

		d = new File(destination);

	}

	if (d.isDirectory()) d = new File(d, srcName );

	if (d.exists() && !d.delete()) throw new IOException("Could not delete " + d.getAbsolutePath());



	fos = new FileOutputStream( d.getPath() ); 





	InputStream input = new BufferedInputStream(srcIn);

	OutputStream out = new BufferedOutputStream(fos);

	out << input;





	return d.getPath();	

} finally {

	if (out != null) out.close();

	if (input != null) input.close();

}

Edited by Guest

  • Author

solved, the function is workig just fine, I just screwed with the results in filemaker

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.