English 中文(简体)
如何确定错误——没有发现中央目录记录签名的终结?
原标题:How to fix error - end of central directory record signature not found?

首先,我将录像带分为以下几段:刺.服务器(视窗),随后我建立了一个档案,我需要移交给另一个服务器(发电机服务器、LC),在这种档案中,录像和(或)图像、框架和数据。

为节约起见,我使用抽取式图书馆(以阿鲁兹语为基础),并使用利用利用模块进行推广。

问题在于,当我向信使发送图像以供处理时,一切照旧;然而,当我发送录像时,我发现这一错误——中央名录记录签名的结尾没有发现。

在我看来,这个问题与偶然或事件流有关。

  • I tried not to use promisify, but then I have the following problem - at the moment when I need to use data from the archive, this archive does not yet exist ( folder do not exist );
  • Tried some more libraries for unarchiving adamzip, unzip, decompress, node-zip;
  • I tried to make a chain of promises;
...
const fs = require( fs-extra )
const path = require( path )
cosnt util = require( util )
const extractZip = util.promisify(require( extract-zip ))
...

...
/**
* Factory that creates a project based on the archive.
* @param {string} archive Path to the source archive
* @returns {Promise.<Project>}
*/
static async create (archive) {
  const dir = fs.mkdtempSync(path.join(this.baseDir,  / ))
  await extractZip(archive, { dir })
  const data = await fs.readJson(path.join(dir,  data.json ))
  return new this(data, dir)
}
...

/* Tried to do this w/ chaining promises:

static async create (archive) {
  const dir = fs.mkdtempSync(path.join(this.baseDir,  / ))
  await extractZip(archive, { dir })
   .then( async () => {
    const data = await fs.readJson(path.join(dir,  data.json ))
    return data
   })
   .then( async (data) => {
    return new this(data, dir)
   })
}

*/


问题回答

我解决这个问题。 它指出,我一直在轻率地从服务器上下载一个大型档案,从而纠正这一时刻,一切照旧。

Wrong:
fs.writeFile(...)
Correct:
fs.writeFileSync(...)

结论:面对一个类似的问题——你应当走到整个数据传输链以及涉及这一链条的职能/召唤。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签