Ciao a tutti
Esistono degli editor per modificare dei file di testo attraverso un'interfaccia flash e poi poterli salvare sul server?
Grazie
Ciao a tutti
Esistono degli editor per modificare dei file di testo attraverso un'interfaccia flash e poi poterli salvare sul server?
Grazie
che problema c'è basta un aplicativo server side che prende i dati da flash o meglio che flash gli ha inviato e li scriva o legga da un file
non è un problema fare la parte flash ma quella server side
appunto, non so da dove iniziare...
Il mio problema è che ho dei file .txt che vorrei fossero modificabili via browser, cn o senza flash...
se vuoi io ho scritto un semplice script che funziona un po come un esplora risorse ti permette ti leggere ,modificare ed uploadare qualsiasi file tutto via web
grazie, mi basterebbe solo leggere e scrivere![]()
///------Browsedir.asp------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<SCRIPT> function validate(){
if (confirm('Sicuro Di Volerlo Cancellare [' + validate.arguments[0] + '] ?' ))
{return true } else return false}
</SCRIPT>
<body>
<%
Server.ScriptTimeOut = 1200
default_pach=server.MapPath("/")
dim objFSO, objSubFolder, objFile, StrCurrentPach, strPach, riga, Colore_Riga, mese
Colore_riga= "#FFFFCC"
sub RigaColore
if riga = 0 then
response.Write("<tr bgcolor="& colore_riga &">")
riga= 1
else
response.Write("<TR>")
riga = 0
end if
end Sub
strCurrentPach = request.QueryString("pach")
if strCurrentPach = "" then
strCurrentPach = default_pach
end if
set objFSO = Server.CreateObject("Scripting.FileSystemObject")
set objFolder = objFSO.GetFolder(strCurrentPach)
if request.QueryString("del")<>"" then
objFso.DeleteFile(request.QueryString("del"))
end if
if request.QueryString("del_folder")<>"" then
objFso.DeleteFolder(request.QueryString("del_folde r"))
end if
response.Write("<h2>Contenuto di
")
response.Write(objFolder.Path & "</h2>
<hr>")
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="37">
<div align="left">
<%
if objFolder.IsRootFolder then
strPach=objFolder.ParentFolder.Path
strPach=Server.URLEncode(strPach)
%>
<A href="Browsedir.asp?pach=<%=strpach%>">[Alla
Directori Superiore ]</A>
<%
end if
if objFolder.Path<>server.MapPath("/") then
%>
[Directori Madre]
<%
end if
%>
</div></td>
<form action="upload.asp" method="post" enctype="multipart/form-data"><div align="right">
<td> <input name="Testo1" type="hidden" id="Testo1" value="<%=objFolder.Path%>">
FILE
<input type="file" name="file1">
<input type="submit" value="Upload">
</div></td></form>
</tr>
</table>
<hr>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<%
For Each objSubFolder in ObjFolder.SubFolders
strPach = Server.URLEncode(objSubFolder.Path)
RigaColore
%>
<td><div align="center"><font size="4"><</font>DIR<font size="4">></font></div></td>
<td><%=objsubFolder.Name%></td>
<td> <div align="center"></div></td>
<td> <div align="right">')">Delete</div></td>
</tr>
<%
Next
Response.Write("
")
for each objfile in objFolder.Files
RigaColore
%>
<td><div align="left"><%=(objFile.Size)/1000 & " KB"%></div></td>
<td><%=objFile.Name%></td>
<td><div align="center">Edit</div></td>
<td><div align="right">')">Delete</div></td>
</tr>
<%
Next
Set objFolder = Nothing
Set objFso = nothing
%>
</table>
<hr>
</body>
</html>
//-------Edit.asp-----
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<body>
<%
Server.ScriptTimeOut = 1200
Const ForReading = 1
Const ForWriter = 2
set ObjFSO = Server.CreateObject("Scripting.FileSystemObject")
Dim ObjOpenFile, ObjFSO, StrPath, StrText
if request.Form("text") <> "" then
Set ObjWriteFile = ObjFSO.OpenTextFile(request.Form("PathFile"),ForWr iter)
Set ObjFile= ObjFSO.GetFile(request.Form("PathFile"))
Path = ObjFile.ParentFolder
ObjWriteFile.Write(request.Form("text"))
Set ObjWriteFile = Nothing
Set ObjFSO = Nothing
response.Redirect("Browsedir.asp?pach="&path )
else
StrPath = request.QueryString("URL")
'StrPath = request.ServerVariables("URL")
'StrPath = server.MapPath(StrPath)
Set ObjOpenFile = ObjFSO.OpenTextFile(StrPath,ForReading)
Do While Not ObjOpenFile.AtEndOfStream
strText = ObjOpenFile.ReadLine
FileName = FileName & server.HTMLEncode(strText) & vbcrlf
Loop
ObjOpenFile.Close
Set OpgOpenFile = Nothing
Set ObjFSO = Nothing
end If
%>
<h2>Contenuto di </h2>
<h3><%=strPath%></h3>
<hr>
<form action="#" method="post" name="Form" target="_parent" id="Form">
<textarea name="text" cols="90" rows="26"><%=FileName%></textarea>
<input name="PathFile" type="hidden" id="URL" value="<%=strPath%>">
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
//------Upload.asp-----
<%
Server.ScriptTimeOut = 1200
'Questa variabile setta il percorso di dove effettuare l'upolad
'la cartella non puo non esistere lo script non la crea ! ! !
ByteRicevuti = Request.TotalBytes
if ByteRicevuti > 0 then
DatiRicevuti = Request.BinaryRead(ByteRicevuti)
For i = 1 To lenB(DatiRicevuti)
FileBinario = FileBinario & chr(ascB(midB(DatiRicevuti,i,1)))
Next
FirmaFile = left(FileBinario,instr(FileBinario,"" & vbCrLf)-1)
ArrPezzi = split(FileBinario,FirmaFile)
for item = 1 to ubound(ArrPezzi)-1
Inizio = instr(ArrPezzi(item),"" & vbCrLf & "" & vbCrLf)
Intestazione = left(ArrPezzi(item),Inizio-1)
Inizio = Inizio + len("" & vbCrLf) + len("" & vbCrLf)
ContenutoFile = mid(ArrPezzi(item),Inizio,len(ArrPezzi(item))-Inizio-1)
' Recupero i campi se sono compilati
if instr(Intestazione,"Testo1") > 0 then
Testo1 = ContenutoFile
end if
if instr(Intestazione,"file1") > 0 then
i = instr(Intestazione,"filename=")
j = instr(i + 10,Intestazione,chr(34))
NomeUpload = mid(Intestazione,i + 10,j-i-10)
i = instrRev(NomeUpload,"\")
if i<>0 then
NomeFile = mid(NomeUpload,i + 1)
else
NomeFile = NomeUpload
end if
if i<>0 then
Set FSO = CreateObject("Scripting.FileSystemObject")
Upload1 = True
DimensioneFile1 = len(ContenutoFile)
EstensioneFile1 = right(ContenutoFile,3)
NomeFile1 = NomeFile
Set textStream = FSO.CreateTextFile(FSO.BuildPath(Testo1,NomeFile1) , True, False)
textStream.Write ContenutoFile
textStream.Close
Set textStream = Nothing
Set FSO = Nothing
end if
end if
next
Response.Write "Il valore immesso nella testo1 è " & testo1 & "
"
If Upload1 = true then
Response.Write "
La dimensione del file che hai uploadato è di " & DimensioneFile1*0.001 & "kb"
Response.Write "
Grazie di aver inviato il tuo file"
%><meta http-equiv="refresh" content="2;URL=index.asp?pach=<%=testo1%>"><%
End If
End if
%>
Divertiti ciao ciao
e fanne un uso coretto
Molte grazie, ho provato e mi sembra uno script ben fatto, ma forse un po' troppo per quello che devo fare...
Su
http://www.otherminds.com/testi/readSave.html
ho messo su uno script flash per editare e salvare dei file txt (dico al momento del loading quali) il tutto attraverso l'aiuto di una pagina asp...
http://www.otherminds.com/testi/aspwrite.zip
Ho già postato altrove questo indirizzo ma forse in questa discussione è più adatto...