Ejemplo n.º 1
0
 public override void MoveTo(string path, MoveToOptions opts)
 {
     if (opts.CanOverwrite && File.Exists(path))
     {
         File.Delete(path);
     }
     TmpFile.MoveTo(path);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Moves an uploaded file to a permanent location.</summary>
 /// <param name="path">the permanent location to move the uploaded file to.</param>
 /// <param name="opts">options associated with moving the file (e.g.
 /// <see cref="MoveToOptions.Overwrite">MoveToOptions.Overwrite</see> or
 /// <see cref="MoveToOptions.None">MoveToOptions.None</see></param>
 /// <remarks>
 /// <para>
 /// The default <see cref="UploadStorageProvider"/> (a <see cref="FilesystemUploadStorageProvider"/>)
 /// temporarily stores uploaded files on disk.  If you don't call MoveTo() in response to the postback, the temporary file will be
 /// automatically deleted.</para>
 /// <para>
 /// The <paramref name="path"/> you pass to MoveTo() is the filesystem path where you want the uploaded file
 /// to be permanently moved.  If you want any existing file at that path to be overwritten, pass
 /// <see cref="MoveToOptions.Overwrite">MoveToOptions.Overwrite</see> as the <paramref name="opts"/>
 /// parameter.  Otherwise, pass <see cref="MoveToOptions.None">MoveToOptions.None</see>.
 /// Only the last call to MoveTo() in response to a particular postback will determine the uploaded file's
 /// permanent location.</para>
 /// <para>
 /// If you are using a non-default <see cref="UploadStorageProvider"/>, it might interpret
 /// <paramref name="path"/> differently.  For example, it might use it as the primary key to identify a row
 /// in a database table.  A non-default <see cref="UploadStorageProvider"/> might also allow other options
 /// by accepting a subclass of <see cref="MoveToOptions"/> for the <paramref name="opts"/> parameter.</para>
 /// </remarks>
 public virtual void MoveTo(string path, MoveToOptions opts)
 {
     file.MoveTo(path, opts);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Moves the file to a permanent location.
 /// </summary>
 /// <param name="path">
 /// The location to which the file should be moved.
 /// </param>
 /// <param name="opts">
 /// A <see cref="MoveToOptions"/> object controlling details of the move,
 /// </param>
 /// <remarks>The <paramref name="path"/> could be a filesystem path or some
 /// other identifier, depending on the storage medium.  The
 /// <paramref name="opts"/> could just be <see cref="MoveToOptions.Overwrite"/>
 /// or <see cref="MoveToOptions.None"/> to control whether any existing file
 /// at the same location should be replaced.  Or, it could be a module-specific
 /// subclass of <see cref="MoveToOptions"/> which provides additional
 /// information.</remarks>
 public abstract void MoveTo(string path, MoveToOptions opts);
Ejemplo n.º 4
0
 /// <summary>
 /// Moves an uploaded file to a permanent location.</summary>
 /// <param name="path">the permanent location to move the uploaded file to.</param>
 /// <param name="opts">options associated with moving the file (e.g. 
 /// <see cref="MoveToOptions.Overwrite">MoveToOptions.Overwrite</see> or 
 /// <see cref="MoveToOptions.None">MoveToOptions.None</see></param>
 /// <remarks>
 /// <para>
 /// The default <see cref="UploadStorageProvider"/> (a <see cref="FilesystemUploadStorageProvider"/>)
 /// temporarily stores uploaded files on disk.  If you don't call MoveTo() in response to the postback, the temporary file will be 
 /// automatically deleted.</para>
 /// <para>  
 /// The <paramref name="path"/> you pass to MoveTo() is the filesystem path where you want the uploaded file
 /// to be permanently moved.  If you want any existing file at that path to be overwritten, pass 
 /// <see cref="MoveToOptions.Overwrite">MoveToOptions.Overwrite</see> as the <paramref name="opts"/> 
 /// parameter.  Otherwise, pass <see cref="MoveToOptions.None">MoveToOptions.None</see>.
 /// Only the last call to MoveTo() in response to a particular postback will determine the uploaded file's
 /// permanent location.</para>
 /// <para>
 /// If you are using a non-default <see cref="UploadStorageProvider"/>, it might interpret 
 /// <paramref name="path"/> differently.  For example, it might use it as the primary key to identify a row 
 /// in a database table.  A non-default <see cref="UploadStorageProvider"/> might also allow other options
 /// by accepting a subclass of <see cref="MoveToOptions"/> for the <paramref name="opts"/> parameter.</para>
 /// </remarks>
 public virtual void MoveTo(string path, MoveToOptions opts)
 {
     file.MoveTo(path, opts);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// If called, this stream is considered "verified" and is allowed to stay in the datadase. If this is never called, the row is deleted
 /// </summary>
 /// <param name="path"><c>Optional</c> If specified, and the target data table has a FileNameField specified, the filename is changed. If <c>null</c> the filename remains the same</param>
 /// <param name="opts">Ignored</param>
 /// <remarks>This slightly aquard behaviour is due to the NeatUpload framework, where "MoveTo" is the only suitable method exposed by InputFile</remarks>
 public override void MoveTo(string path, MoveToOptions opts)
 {
     _verified = true;
     //Change filename in the database
     if (path != null && (
         (_provider.FileNameColumnName != null && _provider.FileNameColumnName.Length > 0) ||
         (_provider.RenameProcedure != null && _provider.RenameProcedure.Length > 0)))
         Rename(path);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Moves the file to a permanent location.
 /// </summary>
 /// <param name="path">
 /// The location to which the file should be moved.
 /// </param>
 /// <param name="opts">
 /// A <see cref="MoveToOptions"/> object controlling details of the move,
 /// </param>
 /// <remarks>The <paramref name="path"/> could be a filesystem path or some
 /// other identifier, depending on the storage medium.  The 
 /// <paramref name="opts"/> could just be <see cref="MoveToOptions.Overwrite"/>
 /// or <see cref="MoveToOptions.None"/> to control whether any existing file
 /// at the same location should be replaced.  Or, it could be a module-specific
 /// subclass of <see cref="MoveToOptions"/> which provides additional 
 /// information.</remarks>
 public abstract void MoveTo(string path, MoveToOptions opts);
Ejemplo n.º 7
0
 public override void MoveTo(string path, MoveToOptions opts)
 {
     if (opts.CanOverwrite && File.Exists(path))
     {
         File.Delete(path);
     }
     TmpFile.MoveTo(path);
 }