How can I modify .xfdl files? (Update #1)

懵懂的女人 提交于 2019-12-04 23:09:41

If the encoding is base64 then this is the solution I've stumbled upon on the web link :

"Decoding XDFL files saved with 'encoding=base64'. Files saved with:

application/vnd.xfdl;content-encoding="base64-gzip"

are simple base64-encoded gzip files. They can be easily restored to XML by first decoding and then unzipping them. This can be done as follows on Ubuntu:

sudo apt-get install uudeview uudeview -i yourform.xfdl gunzip -S "" < UNKNOWN.001 > yourform-unpacked.xfdl 

The first command will install uudeview, a package that can decode base64, among others. You can skip this step once it is installed.

Assuming your form is saved as 'yourform.xfdl', the uudeview command will decode the contents as 'UNKNOWN.001', since the xfdl file doesn't contain a file name. The '-i' option makes uudeview uninteractive, remove that option for more control.

The last command gunzips the decoded file into a file named 'yourform-unpacked.xfdl'. "

Another possible solution - here

Side Note: Block quoted < code > doesn't work for long strings of code

The only answer I can think of right now is - read the manual for uudeview.

As much as I would like to help you, I am not an expert in this area, so you'll have to wait for someone more knowledgable to come down here and help you.

Meanwhile I can give you links to some documents that might help you:

Sorry if this doesn't help you.

Federico Builes

You don't have to get out of Ruby to do this, can use the Base64 module in Ruby to encode the document like this:

irb(main):005:0> require 'base64'
=> true

irb(main):007:0> Base64.encode64("Hello World")
=> "SGVsbG8gV29ybGQ=\n"

irb(main):008:0> Base64.decode64("SGVsbG8gV29ybGQ=\n")
=> "Hello World"

And you can call gzip/gunzip using Kernel#system:

system("gzip foo.something")
system("gunzip foo.something.gz")
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!