|
Upload photo to database?
Last post 02-11-2009, 9:01 PM by cutechat. 33 replies.
-
08-11-2008, 4:01 PM |
-
mainship
-
-
-
Joined on 05-15-2008
-
-
Posts 11
-
-
|
Upload photo to database?
Can I upload a photo into a SQL Server 2005 photo field? Is there an example of how to do that?
Diane
|
|
-
08-11-2008, 4:43 PM |
-
12-16-2008, 11:53 AM |
-
pat333
-
-
-
Joined on 04-22-2004
-
-
Posts 20
-
-
|
Re: Upload photo to database?
Is it possible to do this without saving the file to disc first?
|
|
-
12-16-2008, 3:59 PM |
-
12-17-2008, 4:30 AM |
-
pat333
-
-
-
Joined on 04-22-2004
-
-
Posts 20
-
-
|
Re: Upload photo to database?
Hi,
I have an empty FileUploaded() method and no explicit copyto anywhere but the uploader always says "unable to find the uploaded file in the directory .../UploaderTemp" on an attempted upload
Control is just:
<CuteWebUI:Uploader ID="ctlFormUpload"
OnFileUploaded="ctlFormUpload_FileUploaded" runat="server"
FileTypeNotSupportMsg="Please upload only .doc or .docx files"
>
<validateoption maxsizekb="10240" AllowedFileExtensions="doc,docx" />
</CuteWebUI:Uploader>
|
|
-
12-18-2008, 8:54 AM |
-
cutechat
-
-
-
Joined on 07-22-2004
-
-
Posts 2,332
-
-
|
Re: Upload photo to database?
Hi,
Do you have a folder website/UploaderTemp , and does it has permission to write file?
Please try this way , maybe you can get error details:
<CuteWebUI:Uploader ID="ctlFormUpload"
OnFileUploaded="ctlFormUpload_FileUploaded" runat="server"
FileTypeNotSupportMsg="Please upload only .doc or .docx files"
UploadType="IFrame"
>
Regards,
Terry
|
|
-
12-18-2008, 9:35 AM |
-
pat333
-
-
-
Joined on 04-22-2004
-
-
Posts 20
-
-
|
Re: Upload photo to database?
No. I don't want to store the file to disc - I want to upload directly to database without saving to disc (this is an environment where we don't have any disc write permissions).
|
|
-
12-18-2008, 11:00 AM |
-
cutechat
-
-
-
Joined on 07-22-2004
-
-
Posts 2,332
-
-
|
Re: Upload photo to database?
Hi,
In that case you need use another 'UploaderProvider' , and register the class name to web.config appSettings:
<add key="CuteWebUI.AjaxUploader.Provider" name="UploaderDatabaseProvider.UploaderSqlServerProvider,UploaderDatabaseProvider"/>
Here is the provider implementation code :
-old code deleted-see other reply-
Regards,
Terry
|
|
-
12-18-2008, 11:16 AM |
-
pat333
-
-
-
Joined on 04-22-2004
-
-
Posts 20
-
-
|
Re: Upload photo to database?
Great thanks will give this a go.
|
|
-
01-05-2009, 4:31 AM |
-
pat333
-
-
-
Joined on 04-22-2004
-
-
Posts 20
-
-
|
Re: Upload photo to database?
Hi
I got this working great with a single upload but is it possible to do this with multiple uploads enabled? That seems to require at least the AppendData method which isn't supplied in the code.
|
|
-
01-05-2009, 7:59 PM |
-
cutechat
-
-
-
Joined on 07-22-2004
-
-
Posts 2,332
-
-
|
Re: Upload photo to database?
Hi,
Oh yes.
Since we changed the uploader recently ,
we forgot to implement this sample method.
the AppendData method should be:
-old code deleted-see the following reply-
Please test it and reply me if you get more problem.
Regards,
Terry.
|
|
-
01-15-2009, 6:35 PM |
-
pat333
-
-
-
Joined on 04-22-2004
-
-
Posts 20
-
-
|
Re: Upload photo to database?
Thanks. I am testing this now and it seems to cut files off at 65536 bytes. It apparently uploads fine (no errors, progress goes to 100%) but when looking at what's in the database table, all files uploaded greater than 65536 bytes are reporting just that amount in filesize column. Anything smaller than this is working fine. Is there a configuration setting I'm missing?
|
|
-
01-15-2009, 7:10 PM |
-
pat333
-
-
-
Joined on 04-22-2004
-
-
Posts 20
-
-
|
Re: Upload photo to database?
On investigation, it's only doing this when uploadtype="auto" which I think in this case is silverlight. If I manually set the uploadtype to either iframe or flash, it works ok?
|
|
-
01-15-2009, 9:38 PM |
-
cutechat
-
-
-
Joined on 07-22-2004
-
-
Posts 2,332
-
-
|
Re: Upload photo to database?
Hi,
-old code deleted-
Regards,
Terry
|
|
-
01-16-2009, 4:21 AM |
-
pat333
-
-
-
Joined on 04-22-2004
-
-
Posts 20
-
-
|
Re: Upload photo to database?
Thanks, that seems to have fixed the problem.
|
|
-
01-16-2009, 11:38 AM |
-
pat333
-
-
-
Joined on 04-22-2004
-
-
Posts 20
-
-
|
Re: Upload photo to database?
Actually, sorry - the file size is reporting correct but the larger files are being corrupted when in silverlight mode. Other modes work ok.
|
|
-
01-30-2009, 6:08 AM |
-
pat333
-
-
-
Joined on 04-22-2004
-
-
Posts 20
-
-
|
Re: Upload photo to database?
We have still not managed to get this working.
For all larger files (small files work in all modes) :
- In silverlight mode, uploads go up without error but are corrupted.
- In flash mode, get the message "unable to find the file in custom provider"
- In iframe mode get message 'cannot access uploadtemp'
This is in multiple or single upload mode. Please help.
|
|
-
02-03-2009, 2:08 AM |
-
cutechat
-
-
-
Joined on 07-22-2004
-
-
Posts 2,332
-
-
|
Re: Upload photo to database?
Hi,
Please check this code , we have already tested it :
The old issue is that the offset of append data is wrong. Sorry for the inconvenience.
Regards,
Terry
|
|
-
02-03-2009, 2:16 AM |
-
cutechat
-
-
-
Joined on 07-22-2004
-
-
Posts 2,332
-
-
|
Re: Upload photo to database?
Web.config :
<add key="UploaderDatabase" value="server=(local);database=UploaderSamples;uid=test;pwd=test"/>
<add key="CuteWebUI.AjaxUploader.Provider" value="UploaderDatabaseProvider.UploaderSqlServerProvider,App_Code"/>
Sql Schema:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AjaxUploaderTempFiles]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[AjaxUploaderTempFiles]
GO
CREATE TABLE [dbo].[AjaxUploaderTempFiles] (
[FileGuid] [uniqueidentifier] NOT NULL ,
[FileTime] [datetime] NOT NULL ,
[FileName] [nvarchar] (255)
[FileSize] [int] NOT NULL ,
[FileData] [image] NOT NULL ,
[IsPersist] [bit] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[AjaxUploaderTempFiles] WITH NOCHECK ADD
CONSTRAINT [PK_AjaxUploaderTempFiles] PRIMARY KEY CLUSTERED
(
[FileGuid]
) ON [PRIMARY]
GO
|
|
-
02-03-2009, 5:29 AM |
-
pat333
-
-
-
Joined on 04-22-2004
-
-
Posts 20
-
-
|
Re: Upload photo to database?
With your updated code this is working in silverlight mode now (for files that weren't before), but not in flash or iframe mode. In flash mode, get the message "cannot find the file in custom provider" and iframe get the message "Access to the path C:\....\UploaderTemp is denied"
|
|
Page 1 of 2 (34 items)
1
|
|
|