code: func (a *API) AddFile(ctx context.Context, mhash, path, fname string, content []byte, nameresolver bool) (storage.Address, string, error) {
  	apiAddFileCount.Inc(1)
  
  	uri, err := Parse("bzz:/" + mhash)
  	if err != nil {
  		apiAddFileFail.Inc(1)
  		return nil, "", err
  	}
  	mkey, err := a.ResolveURI(ctx, uri, EmptyCredentials)
  	if err != nil {
  		apiAddFileFail.Inc(1)
  		return nil, "", err
  	}
  
  	// trim the root dir we added
  	if path[:1] == "/" {
  		path = path[1:]
  	}
  
  	entry := &ManifestEntry{
  		Path:        filepath.Join(path, fname),
  		ContentType: mime.TypeByExtension(filepath.Ext(fname)),
  		Mode:        0700,
  		Size:        int64(len(content)),
  		ModTime:     time.Now(),
  	}
  
  	mw, err := a.NewManifestWriter(ctx, mkey, nil)
  	if err != nil {
  		apiAddFileFail.Inc(1)
  		return nil, "", err
  	}
  
  	fkey, err := mw.AddEntry(ctx, bytes.NewReader(content), entry)
  	if err != nil {
  		apiAddFileFail.Inc(1)
  		return nil, "", err
  	}
  
  	newMkey, err := mw.Store()
  	if err != nil {
  		apiAddFileFail.Inc(1)
  		return nil, "", err
  
  	}
  
  	return fkey, newMkey.String(), nil
  }
docs: // AddFile creates a new manifest entry, adds it to swarm, then adds a file to swarm.