This topic is locked

Upload Image Path

12/26/2004 8:48:31 AM
ASPRunnerPro General questions
W
wsniper author

I would like to create a Page which stores an image Path in a field (type = text),

which upload the file into server and store the path in database.

The table name = Products.

the firld name = ImagePath.

the upload folder= Uploads.

I'm modify the [view as] For this field To [file Based Image] --> (it work properly)

and the [Edit As ] To [ ?? ] ---> I dont Know what I must put there :

there is [database image] & [ database file] Option

I try the both , and the error message appear

I think putting [edit as] to [database image] require field with binary type not text.
The database field should contain the filename and that's it.
Note I read the Topic :

http://www.asprunner.com/forums/index.php?...p?showtopic=874

but It Cause error always , even though Make the security of the

uploads directory into full control(read/write)
Please Tell Me The Way to make this , because I'm try to used it with our work

and if u can help me to make the program work more days , because it has only two days to stop.
very 10x

Admin 12/30/2004

Hi,
here is how you cando this:

  1. ImagePath field

    Set View as to File-based image, Edit as to Text field. Simply put there path to image file on the server.
  2. Dummy field

    Do not show this field on the List page, set Edit as to Database-based image. This will create a file upload field on the Edit page which you should use to upload image files.
  3. Modify uploader.asp file to upload files to Uploads directory on the Web server according to http://www.asprunner.com/forums/index.php?...p?showtopic=874
  4. Make sure Uploads directory has write permissions for Everyone.
    This is it.

W
wsniper author 12/30/2004

10x 4 ur reply

[SIZE=7][COLOR=blue]
This Error Message Display When I Press On Upload Button .

Note : I Convert The Permission In upload directary to everyone(full control)
Technical Information (for support personnel)

• Error Type:

ADODB.Stream (0x800A0BBC)

Write to file failed.

/test/include/clsField.asp, line 178

• Browser Type:

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)

• Page:

POST 5119 bytes to /test/uploader.asp

• POST Data:

error '80020009'

Exception occurred.

/iisHelp/common/500-100.asp, line 223
But I Solved This Problem You Can Do That:

In My Access DataBase Under Name [01.mdb] I Have Table Under [Customers] Name

This Table Contain The Following Fields :
Name Type Values

-----------------------------------------------------------------------------

ID AutoNumber 1,2,3,4,.....

Name Text Tony, Ali, Omar, George, .......

Image_Path Text uploads/01.jpg, uploads/02.jpg, ......

Image_Binary OLE Object Not Used (Always Will Be Empty-Dumy)
In The AspRunner:

Within Formatting Section :

  1. Change The Label For [Image_Path] And [Image_Binary] Into [Image]

    2)Only List The [Image_Path]

    3)[File-Based Image] In [View as] For [Image_Path]

    4)Remove [Add Page] For [Image_Path] And [Image_Binary]

    5)Remove [Edit Page] For [Image_Path]

    6)[DataBase Image] In [Edit As] For [Image_Binary]
    7)Replace The Following Code In Uploader.asp File
    objRs.Open "SELECT " & strPK & ", " & AddWrappers(strField) & " FROM " & AddWrappers(strTable) & " WHERE " & sWhere, objConn, adOpenKeyset, adLockOptimistic

    objRs.Fields(strField).AppendChunk objUpload("File1").BLOB & ChrB(0)
    With This
    objRs.Open "SELECT Image_Path, " & strPK & ", " & AddWrappers(strField) & " FROM " & AddWrappers(strTable) & " WHERE " & sWhere, objConn, adOpenKeyset, adLockOptimistic

    objRs("Image_Path") = "uploads\" & objUpload("File1").FileName

    objRs.Fields(strField).AppendChunk objUpload("File1").BLOB & ChrB(0)

W
wsniper author 12/30/2004

<font size="6" color="blue">
uploads : Is A directory Create It Behind The Other ASPRunner Files

Image_Path : Is The Field In My Database as I display Up, U Can Change It's

as u need

</font>
objRs.Open "SELECT Image_Path , " & strPK & ", " & AddWrappers(strField) & " FROM " & AddWrappers(strTable) & " WHERE " & sWhere, objConn, adOpenKeyset, adLockOptimistic

objRs("Image_Path ") = "uploads\" & objUpload("File1").FileName

objRs.Fields(strField).AppendChunk objUpload("File1").BLOB & ChrB(0)

W
wsniper author 12/31/2004

<span style='font-size:14pt;line-height:100%'>
Sorry This How To Take The Image Or File Name
But How To Upload This File Into Server Directory(Uploads)

Please Administrator to take into consideration The Error Message

That appear (posted above)
yalla 10x 4 ur tired

</span>

Admin 1/3/2005

Besides checking directory permissions I would recommend to make sure you don't have READONLY file with the same name in uploads directory.
If this doesn't help you can create a simple ASP file that creates a file in uploads directory and writes something there. This can help you to find if correct permissions are in place.

S
salamander 3/8/2007

Hello...using ASP Runner for a bit now and I love it. My question/problem as it relates to this solution below.
I am unable to find the uploader.asp file as mentioned.
Just to clear this up...I have successfully created an upload function. I want the name of the file "pic.gif" to be entered into the database because right now I have to manually enter the filename into the text filed of database to get the picture to appear.
Any help would be appreciated. Best regards and thanks!!
Sal

Hi,

here is how you cando this:

  1. ImagePath field

    Set View as to File-based image, Edit as to Text field. Simply put there path to image file on the server.
  2. Dummy field

    Do not show this field on the List page, set Edit as to Database-based image. This will create a file upload field on the Edit page which you should use to upload image files.
  3. Modify uploader.asp file to upload files to Uploads directory on the Web server according to http://www.asprunner.com/forums/index.php?...p?showtopic=874
  4. Make sure Uploads directory has write permissions for Everyone.
    This is it.

S
salamander 3/8/2007

Hello...using ASP Runner for a bit now and I love it. My question/problem as it relates to this solution below.
I am unable to find the uploader.asp file as mentioned.
Just to clear this up...I have successfully created an upload function. I want the name of the file "pic.gif" to be entered into the database because right now I have to manually enter the filename into the text filed of database to get the picture to appear.
Any help would be appreciated. Best regards and thanks!!
Sal
QUOTE(admin @ Dec 30 2004, 08:39 AM)

Hi,
here is how you cando this:

  1. ImagePath field

    Set View as to File-based image, Edit as to Text field. Simply put there path to image file on the server.
  2. Dummy field

    Do not show this field on the List page, set Edit as to Database-based image. This will create a file upload field on the Edit page which you should use to upload image files.
  3. Modify uploader.asp file to upload files to Uploads directory on the Web server according to http://www.asprunner.com/forums/index.php?...p?showtopic=874
  4. Make sure Uploads directory has write permissions for Everyone.
    This is it.
    I would like to create a Page which stores an image Path in a field (type = text),

    which upload the file into server and store the path in database.

    The table name = Products.

    the firld name = ImagePath.

    the upload folder= Uploads.

    I'm modify the [view as] For this field To [file Based Image] --> (it work properly)

    and the [Edit As ] To [ ?? ] ---> I dont Know what I must put there :

    there is [database image] & [ database file] Option

    I try the both , and the error message appear

    I think putting [edit as] to [database image] require field with binary type not text.
    The database field should contain the filename and that's it.
    Note I read the Topic :

    http://www.asprunner.com/forums/index.php?...p?showtopic=874

    but It Cause error always , even though Make the security of the

    uploads directory into full control(read/write)
    Please Tell Me The Way to make this , because I'm try to used it with our work

    and if u can help me to make the program work more days , because it has only two days to stop.
    very 10x